@@ -1301,66 +1301,64 @@ Write-Host "." -NoNewline -ForegroundColor Cyan
13011301
13021302# Get environment details
13031303# CloudBuilder
1304- if (test-path " C:\CloudDeployment\Setup\InstallAzureStackPOC.ps1" ) {
1305-
1306- if (! (test-path " C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" )){
1307- # Deployment not initialized
1308- $Script :Initialized = " CloudBuilder_Install"
1309- $syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
1310- $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
1311- $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
1312- }
1313- else {
1314- # Import module to check current deployment status
1315- Import-Module " C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" - Force - Verbose:$false
1316- $actionProgress = Get-ActionProgress - ActionType Deployment
1317- # Deployment not started
1318- if (! ($actionProgress )){
1304+ if (test-path " C:\CloudDeployment\Setup\InstallAzureStackPOC.ps1" ) {
1305+ if (! (test-path " C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" )){
1306+ # Deployment not initialized
13191307 $Script :Initialized = " CloudBuilder_Install"
13201308 $syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
13211309 $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
13221310 $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
13231311 }
1324- # Deployment in progress
1325- elseif ($actionProgress.LastAttribute.Value -eq ' InProgress' ){
1326- # Not deployed with deployment UI
1327- if (! (test-path " C:\CloudDeployment\Rerun\config.xml" )){
1328- New-Item C:\CloudDeployment\Rerun - type directory - Force
1329- ' <config status="rerun" run="0"/>' | Out-File C:\CloudDeployment\Rerun\config.xml
1330- $Script :Initialized = " CloudBuilder_Rerun"
1331- $syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
1332- $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
1333- $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1334- }
1335- # Deployed with deployment UI
1336- else {
1337- $Status = [XML ](Get-Content " C:\CloudDeployment\Rerun\config.xml" )
1338- # Contains only 1 or 2 deployment logs
1339- if ($status.config.status -eq " Rerun" -and [int ]$status.config.run -le 2 ){
1312+ else {
1313+ # Import module to check current deployment status
1314+ Import-Module " C:\CloudDeployment\ECEngine\EnterpriseCloudEngine.psd1" - Force - Verbose:$false
1315+ $actionProgress = Get-ActionProgress - ActionType Deployment
1316+ # Deployment not started
1317+ if (! ($actionProgress )){
1318+ $Script :Initialized = " CloudBuilder_Install"
1319+ $syncHash.Control_Header_Tbl_Title.Text = $Text_Install.Mode_Title
1320+ $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Install.Mode_LeftTitle
1321+ $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Install.Mode_LeftContent
1322+ }
1323+ # Deployment completed successfully
1324+ elseif ($actionProgress.Attribute (" Status" ).Value -eq ' Success' ){
1325+ $Script :Initialized = " CloudBuilder_Completed_GatherLogs"
1326+ $syncHash.Control_Header_Tbl_Title.Text = $Text_Completed.Mode_Title
1327+ $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Completed.Mode_LeftTitle
1328+ $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Completed.Mode_LeftContent
1329+ }
1330+ # Deployment in progress or stopped
1331+ else {
1332+ # Not deployed with deployment UI
1333+ if (! (test-path " C:\CloudDeployment\Rerun\config.xml" )){
1334+ New-Item C:\CloudDeployment\Rerun - type directory - Force
1335+ ' <config status="rerun" run="0"/>' | Out-File C:\CloudDeployment\Rerun\config.xml
13401336 $Script :Initialized = " CloudBuilder_Rerun"
13411337 $syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
13421338 $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
13431339 $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1344- }
1345- # Contains 2 or more deplployment logs
1340+ }
1341+ # Deployed with deployment UI
13461342 else {
1347- $Script :Initialized = " CloudBuilder_Rerun_GatherLogs"
1348- $syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title_Logs
1349- $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle_Logs
1350- $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent_Logs
1343+ $Status = [XML ](Get-Content " C:\CloudDeployment\Rerun\config.xml" )
1344+ # Contains only 1 or 2 deployment logs
1345+ if ($status.config.status -eq " Rerun" -and [int ]$status.config.run -le 2 ){
1346+ $Script :Initialized = " CloudBuilder_Rerun"
1347+ $syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title
1348+ $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle
1349+ $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent
1350+ }
1351+ # Contains 2 or more deployment logs
1352+ else {
1353+ $Script :Initialized = " CloudBuilder_Rerun_GatherLogs"
1354+ $syncHash.Control_Header_Tbl_Title.Text = $Text_Rerun.Mode_Title_Logs
1355+ $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Rerun.Mode_LeftTitle_Logs
1356+ $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Rerun.Mode_LeftContent_Logs
13511357 }
13521358 }
13531359 }
1354- else {
1355- # Deployment completed
1356- $Script :Initialized = " CloudBuilder_Completed_GatherLogs"
1357- $syncHash.Control_Header_Tbl_Title.Text = $Text_Completed.Mode_Title
1358- $syncHash.Control_Mode_Tbl_LeftTitle.Text = $Text_Completed.Mode_LeftTitle
1359- $syncHash.Control_Mode_Tbl_LeftContent.Text = $Text_Completed.Mode_LeftContent
13601360 }
13611361
1362- }
1363-
13641362 # Reboot options
13651363 F_Reboot_Options
13661364 $syncHash.Control_Mode_Tbl_RightTitle.Text = $Text_Install.Mode_RightTitle
@@ -1666,12 +1664,12 @@ If ($synchash.Control_NetConfig_Rbt_Static.IsChecked){
16661664 }
16671665
16681666If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0 ){
1669- $InstallScript += " -PublicVLan "
1667+ $InstallScript += " -PublicVlanId "
16701668 $InstallScript += $synchash.Control_NetConfig_Tbx_VlanID.Text
16711669 }
16721670
16731671If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0 ){
1674- $InstallScript += " -EnvironmentDNS "
1672+ $InstallScript += " -DNSForwarder "
16751673 $InstallScript += $synchash.Control_NetConfig_Tbx_DnsForwarder.Text
16761674 }
16771675
@@ -1743,11 +1741,11 @@ Function F_Install {
17431741 }
17441742
17451743 If ($synchash.Control_NetConfig_Tbx_VlanID.Text.Length -gt 0 ){
1746- ' -PublicVLan "' + $synchash.Control_NetConfig_Tbx_VlanID.Text + ' "' | Add-Content $filepath - NoNewline
1744+ ' -PublicVlanId "' + $synchash.Control_NetConfig_Tbx_VlanID.Text + ' "' | Add-Content $filepath - NoNewline
17471745 }
17481746
17491747 If ($synchash.Control_NetConfig_Tbx_DnsForwarder.Text.Length -gt 0 ){
1750- ' -EnvironmentDNS "' + $synchash.Control_NetConfig_Tbx_DnsForwarder.Text + ' "' | Add-Content $filepath - NoNewline
1748+ ' -DNSForwarder "' + $synchash.Control_NetConfig_Tbx_DnsForwarder.Text + ' "' | Add-Content $filepath - NoNewline
17511749 }
17521750
17531751 If ($synchash.Control_NetConfig_Tbx_TimeServer.Text.Length -gt 0 ){
@@ -1764,7 +1762,7 @@ Function F_Install {
17641762 # endregion Rerun Count
17651763
17661764 # region Install
1767- Start-Process powershell $filepath
1765+ Start-Process powershell - ArgumentList " -noexit " , " -file $filepath "
17681766 # endregion
17691767
17701768}
0 commit comments