@@ -17,7 +17,7 @@ if($virtualMachineName -eq '' -or $virtualMachineName -eq $null) {
1717
1818if ($managementSubnetName -eq ' ' -or $managementSubnetName -eq $null ) {
1919 $managementSubnetName = ' Management'
20- Write-Host " Using subnet 'Management'." - ForegroundColor Green
20+ Write-Host " Using subnet 'Management' to deploy jumpbox VM ." - ForegroundColor Green
2121}
2222
2323function VerifyPSVersion
@@ -39,26 +39,27 @@ function EnsureLogin ()
3939 $context = Get-AzureRmContext
4040 If ($null -eq $context.Subscription )
4141 {
42- Write-Host " Loging in ..."
42+ Write-Host " Sign-in ..."
4343 If ($null -eq (Login- AzureRmAccount - ErrorAction SilentlyContinue - ErrorVariable Errors))
4444 {
45- Write-Host (" Login failed: {0}" -f $Errors [0 ].Exception.Message) - ForegroundColor Red
45+ Write-Host (" Sign-in failed: {0}" -f $Errors [0 ].Exception.Message) - ForegroundColor Red
4646 Break
4747 }
4848 }
49- Write-Host " User logedin ." - ForegroundColor Green
49+ Write-Host " Sign-in successful ." - ForegroundColor Green
5050}
5151
5252function SelectSubscriptionId {
5353 param (
5454 $subscriptionId
5555 )
56- Write-Host " Selecting subscription '$subscriptionId '."
56+ Write-Host " Selecting subscription '$subscriptionId '... "
5757 $context = Get-AzureRmContext
5858 If ($context.Subscription.Id -ne $subscriptionId )
5959 {
6060 Try
6161 {
62+ Write-Host " Switching subscription $context .Subscription.Id to '$subscriptionId '." - ForegroundColor Green
6263 Select-AzureRmSubscription - SubscriptionId $subscriptionId - ErrorAction Stop | Out-null
6364 }
6465 Catch
@@ -79,16 +80,15 @@ function LoadVirtualNetwork {
7980 $virtualNetwork = Get-AzureRmVirtualNetwork - ResourceGroupName $resourceGroupName - Name $virtualNetworkName - ErrorAction SilentlyContinue
8081 If ($null -ne $virtualNetwork.Id )
8182 {
82- Write-Host " Virtual network loaded." - ForegroundColor Green
83+ Write-Host " Virtual network with id $virtualNetwork .Id is loaded." - ForegroundColor Green
8384 If ($virtualNetwork.VirtualNetworkPeerings.Count -gt 0 ) {
84- Write-Host " Virtual should not have peerings." - ForegroundColor Red
85+ Write-Host " Virtual network is loaded, but it should not have peerings." - ForegroundColor Red
8586 }
86-
8787 return $virtualNetwork
8888 }
8989 else
9090 {
91- Write-Host " Virtual network not found." - ForegroundColor Red
91+ Write-Host " Virtual network cannot be found." - ForegroundColor Red
9292 Break
9393 }
9494}
@@ -104,7 +104,7 @@ function SetVirtualNetwork
104104 }
105105 Catch
106106 {
107- Write-Host " Failed: $_ " - ForegroundColor Red
107+ Write-Host " Failed to configure Virtual Network : $_ " - ForegroundColor Red
108108 }
109109}
110110
@@ -189,7 +189,7 @@ If($false -eq $subnets.Contains($managementSubnetName))
189189 SetVirtualNetwork $virtualNetwork
190190 Write-Host " Added subnet $managementSubnetName into VNet." - ForegroundColor Green
191191} else {
192- Write-Host " The subnet $managementSubnetName already exists in the VNet." - ForegroundColor Green
192+ Write-Host " The subnet $managementSubnetName exists in the VNet." - ForegroundColor Green
193193}
194194
195195Write-Host
@@ -205,6 +205,6 @@ $templateParameters = @{
205205 administratorLoginPassword = $administratorLoginPassword
206206}
207207
208- # New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri ($scriptUrlBase+'/azuredeploy.json?t='+ [DateTime]::Now.Ticks) -TemplateParameterObject $templateParameters
208+ New-AzureRmResourceGroupDeployment - ResourceGroupName $resourceGroupName - TemplateUri ($scriptUrlBase + ' /azuredeploy.json?t=' + [DateTime ]::Now.Ticks) - TemplateParameterObject $templateParameters
209209
210- Write-Host " Deployment completed"
210+ Write-Host " Deployment completed. "
0 commit comments