@@ -29,7 +29,7 @@ The Azure Stack Development Kit installer UI script is based on PowerShell and t
2929
3030# region Text
3131$Text_Generic = @ {}
32- $Text_Generic.Version = " 1.0.13 "
32+ $Text_Generic.Version = " 1.0.12 "
3333$Text_Generic.Password_NotMatch = " Passwords do not match"
3434$Text_Generic.Regex_Fqdn = " <yourtenant.onmicrosoft.com> can only contain A-Z, a-z, 0-9, dots and a hyphen"
3535$Text_Generic.Regex_Computername = " Computername must be 15 characters or less and can only contain A-Z, a-z, 0-9 and a hyphen"
@@ -65,7 +65,7 @@ $Text_Install.Mode_RightContent = "Select the Operating System to override the d
6565$Text_Install.Reboot_Title = " Reboot"
6666$Text_Install.NetInterface_Title = " Select Network Interface for the Azure Stack host"
6767$Text_Install.NetInterface_Warning = " Only one adapter can be used for the Azure Stack Development Kit host. Select the adapter used for the deployment. All other adapters will be disabled by the installer. Ensure you have network connectivity to the selected network adapter before proceeding."
68- $Text_Install.NetConfig_Title = " Network Configuration"
68+ $Text_Install.NetConfig_Title = " Network Configuration for BGPNAT01 "
6969$Text_Install.Credentials_Title = " Specify Identity Provider and Credentials"
7070$Text_Install.Summary_Title = " Summary"
7171$Text_Install.Summary_Content = " The following script will be used for deploying the Development Kit"
@@ -1189,11 +1189,17 @@ $Xaml = @'
11891189 <!--#region NetConfig-->
11901190 <StackPanel x:Name="Control_NetConfig_Stp" HorizontalAlignment="Left" Visibility="Collapsed">
11911191 <StackPanel Height="320">
1192- <StackPanel Orientation="Horizontal" Margin="0,0,0,10" x:Name="Control_NetConfig_Stp_IpAddress">
1192+ <RadioButton x:Name="Control_NetConfig_Rbt_DHCP" GroupName="NetworkConfig" VerticalContentAlignment="Center" Cursor="Hand" Margin="0,0,0,5" IsChecked="True" >
1193+ <TextBlock FontSize="14" FontFamily="Segoe UI" Text="DHCP" Width="100" HorizontalAlignment="Left" Padding="5,0,0,0"/>
1194+ </RadioButton>
1195+ <RadioButton x:Name="Control_NetConfig_Rbt_Static" GroupName="NetworkConfig" VerticalContentAlignment="Center" Cursor="Hand" Margin="0,0,0,10" >
1196+ <TextBlock FontSize="14" FontFamily="Segoe UI" Text="Static" Width="100" HorizontalAlignment="Left" Padding="5,0,0,0"/>
1197+ </RadioButton>
1198+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
11931199 <TextBlock x:Name="Control_NetConfig_Tbl_IpAddress" FontSize="14" FontFamily="Segoe UI" Text="Ip Address:" Width="120" HorizontalAlignment="Left"/>
11941200 <TextBox x:Name="Control_NetConfig_Tbx_IpAddress" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Width="430" IsEnabled="False" AutomationProperties.LabeledBy="{Binding ElementName=Control_NetConfig_Tbl_IpAddress}"/>
11951201 </StackPanel>
1196- <StackPanel Orientation="Horizontal" Margin="0,0,0,10" x:Name="Control_NetConfig_Stp_Gateway" >
1202+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
11971203 <TextBlock x:Name="Control_NetConfig_Tbl_Gateway" FontSize="14" FontFamily="Segoe UI" Text="Gateway:" Width="120" HorizontalAlignment="Left"/>
11981204 <TextBox x:Name="Control_NetConfig_Tbx_Gateway" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Width="430" IsEnabled="False" AutomationProperties.LabeledBy="{Binding ElementName=Control_NetConfig_Tbl_Gateway}"/>
11991205 </StackPanel>
@@ -1207,6 +1213,10 @@ $Xaml = @'
12071213 </StackPanel>
12081214 <StackPanel x:Name="Control_NetConfig_Stp_Optional">
12091215 <TextBlock FontSize="16" FontFamily="Segoe UI" Text="Optional Configuration" Margin="0,0,0,10"/>
1216+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
1217+ <TextBlock x:Name="Control_NetConfig_Tbl_VlanID" FontSize="14" FontFamily="Segoe UI" Text="VLAN ID:" Width="120" HorizontalAlignment="Left"/>
1218+ <TextBox x:Name="Control_NetConfig_Tbx_VlanID" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Width="430" AutomationProperties.LabeledBy="{Binding ElementName=Control_NetConfig_Tbl_VlanID}" />
1219+ </StackPanel>
12101220 <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
12111221 <TextBlock x:Name="Control_NetConfig_Tbl_DnsForwarder" FontSize="14" FontFamily="Segoe UI" Text="DNS Forwarder IP:" Width="120" HorizontalAlignment="Left"/>
12121222 <TextBox x:Name="Control_NetConfig_Tbx_DnsForwarder" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Width="430" AutomationProperties.LabeledBy="{Binding ElementName=Control_NetConfig_Tbl_DnsForwarder}"/>
@@ -1997,12 +2007,19 @@ Function F_VerifyFields_NetConfig {
19972007 Else {$syncHash.Control_NetConfig_Btn_Next.IsEnabled = $false }
19982008 }
19992009 else {
2000- if (($syncHash.Control_NetConfig_Tbx_TimeServer.Text -and ($syncHash.Control_NetConfig_Tbx_TimeServer.BorderBrush.color -ne " #FFFF0000" ))) {
2001- $syncHash.Control_NetConfig_Btn_Next.IsEnabled = $true
2002- }
2003- Else {
2004- $syncHash.Control_NetConfig_Btn_Next.IsEnabled = $false
2005- }
2010+ if (
2011+ (
2012+ $syncHash.Control_NetConfig_Rbt_DHCP.IsChecked -eq $true -and
2013+ ($syncHash.Control_NetConfig_Tbx_TimeServer.Text -and ($syncHash.Control_NetConfig_Tbx_TimeServer.BorderBrush.color -ne " #FFFF0000" ))
2014+ ) -or
2015+ (
2016+ $syncHash.Control_NetConfig_Rbt_Static.IsChecked -eq $true -and
2017+ ($syncHash.Control_NetConfig_Tbx_IpAddress.Text -and ($syncHash.Control_NetConfig_Tbx_IpAddress.BorderBrush.color -ne " #FFFF0000" )) -and
2018+ ($syncHash.Control_NetConfig_Tbx_Gateway.Text -and ($syncHash.Control_NetConfig_Tbx_Gateway.BorderBrush.color -ne " #FFFF0000" )) -and
2019+ ($syncHash.Control_NetConfig_Tbx_TimeServer.Text -and ($syncHash.Control_NetConfig_Tbx_TimeServer.BorderBrush.color -ne " #FFFF0000" ))
2020+ )
2021+ ) {$syncHash.Control_NetConfig_Btn_Next.IsEnabled = $true }
2022+ Else {$syncHash.Control_NetConfig_Btn_Next.IsEnabled = $false }
20062023 }
20072024}
20082025
@@ -2120,6 +2137,21 @@ Function F_Summary {
21202137 $InstallScript += " -UseADFS"
21212138 }
21222139
2140+ If ($synchash.Control_NetConfig_Rbt_Static.IsChecked ) {
2141+ $NetworkID = F_GetNetworkID
2142+ $InstallScript += " -NatIPv4Subnet "
2143+ $InstallScript += $NetworkID
2144+ $InstallScript += " -NatIPv4Address "
2145+ $InstallScript += $synchash.Control_NetConfig_Tbx_IpAddress.Text.Split (" /" )[0 ]
2146+ $InstallScript += " -NatIPv4DefaultGateway "
2147+ $InstallScript += $synchash.Control_NetConfig_Tbx_Gateway.Text
2148+ }
2149+
2150+ If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0 ) {
2151+ $InstallScript += " -PublicVlanId "
2152+ $InstallScript += $synchash.Control_NetConfig_Tbx_VlanID.Text
2153+ }
2154+
21232155 If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0 ) {
21242156 $InstallScript += " -DNSForwarder "
21252157 $InstallScript += $synchash.Control_NetConfig_Tbx_DnsForwarder.Text
@@ -2192,6 +2224,17 @@ Function F_Install {
21922224 ' -UseADFS' | Add-Content $filepath - NoNewline
21932225 }
21942226
2227+ If ($synchash.Control_NetConfig_Rbt_Static.IsChecked ) {
2228+ $NetworkID = F_GetNetworkID
2229+ ' -NatIPv4Subnet "' + $NetworkID + ' "' | Add-Content $filepath - NoNewline
2230+ ' -NatIPv4Address "' + $synchash.Control_NetConfig_Tbx_IpAddress.Text.Split (" /" )[0 ] + ' "' | Add-Content $filepath - NoNewline
2231+ ' -NatIPv4DefaultGateway "' + $synchash.Control_NetConfig_Tbx_Gateway.Text + ' "' | Add-Content $filepath - NoNewline
2232+ }
2233+
2234+ If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0 ) {
2235+ ' -PublicVlanId "' + $synchash.Control_NetConfig_Tbx_VlanID.Text + ' "' | Add-Content $filepath - NoNewline
2236+ }
2237+
21952238 If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0 ) {
21962239 ' -DNSForwarder "' + $synchash.Control_NetConfig_Tbx_DnsForwarder.Text + ' "' | Add-Content $filepath - NoNewline
21972240 }
@@ -2524,15 +2567,15 @@ $syncHash.Control_NetInterface_Btn_Next.Add_Click({
25242567 If ($Script :Initialized -eq " SafeOS" ) {
25252568 $syncHash.Control_NetConfig_Stp.Visibility = " Visible"
25262569 $syncHash.Control_Header_Tbl_Title.Text = $Text_SafeOS.NetConfig_Title
2570+ $SyncHash.Control_NetConfig_Rbt_Static.Visibility = " Collapsed"
2571+ $SyncHash.Control_NetConfig_Rbt_DHCP.Visibility = " Collapsed"
25272572 $SyncHash.Control_NetConfig_Stp_Optional.Visibility = " Collapsed"
25282573 F_CopyNicProperties
25292574 }
25302575 Else {
25312576 $syncHash.Control_NetConfig_Stp.Visibility = " Visible"
25322577 $syncHash.Control_Header_Tbl_Title.Text = $Text_Install.NetConfig_Title
25332578 $syncHash.Control_NetConfig_Stp_DNS.Visibility = " Collapsed"
2534- $syncHash.Control_NetConfig_Stp_IpAddress.Visibility = " Collapsed"
2535- $syncHash.Control_NetConfig_Stp_Gateway.Visibility = " Collapsed"
25362579 }
25372580})
25382581
@@ -2578,6 +2621,28 @@ $syncHash.Control_NetConfig_Btn_Next.Add_Click({
25782621 }
25792622})
25802623
2624+ $syncHash.Control_NetConfig_Rbt_DHCP.Add_Click ({
2625+ $syncHash.Control_NetConfig_Tbx_IpAddress.IsEnabled = $false
2626+ $syncHash.Control_NetConfig_Tbx_IpAddress.Clear ()
2627+ $syncHash.Control_NetConfig_Tbx_Gateway.IsEnabled = $false
2628+ $syncHash.Control_NetConfig_Tbx_Gateway.Clear ()
2629+ $syncHash.Control_NetConfig_Tbx_DNS.IsEnabled = $false
2630+ $syncHash.Control_NetConfig_Tbx_DNS.Clear ()
2631+ F_VerifyFields_NetConfig
2632+ })
2633+
2634+ $syncHash.Control_NetConfig_Rbt_Static.Add_Click ({
2635+ $syncHash.Control_NetConfig_Tbx_IpAddress.IsEnabled = $true
2636+ $syncHash.Control_NetConfig_Tbx_Gateway.IsEnabled = $true
2637+ $syncHash.Control_NetConfig_Tbx_DNS.IsEnabled = $true
2638+
2639+ if ($script :Initialized -eq " SafeOS" ){
2640+ F_CopyNicProperties
2641+ }
2642+
2643+ F_VerifyFields_NetConfig
2644+ })
2645+
25812646$syncHash.Control_NetConfig_Tbx_IpAddress.Add_TextChanged ({
25822647 F_Regex - field ' Control_NetConfig_Tbx_IpAddress' - field_value $syncHash.Control_NetConfig_Tbx_IpAddress.Text - regex $Regex.IpAddressCidr - message $Text_Generic.Regex_IpAddressCidr
25832648 F_VerifyFields_NetConfig
0 commit comments