File tree Expand file tree Collapse file tree
samples/manage/azure-sql-db-managed-instance/prepare-subnet Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function Ensure-Login ()
1414 Write-Host " Loging in ..."
1515 If ((Login- AzureRmAccount - ErrorAction SilentlyContinue - ErrorVariable Errors) -eq $null )
1616 {
17- Write-Host (" Login failed: {0}" -f $Errors.Message ) - ForegroundColor Red
17+ Write-Host (" Login failed: {0}" -f $Errors [ 0 ].Exception .Message) - ForegroundColor Red
1818 Break
1919 }
2020 }
@@ -36,7 +36,7 @@ function Select-SubscriptionId {
3636 Catch
3737 {
3838 Write-Host " Subscription selection failed: $_ " - ForegroundColor Red
39- Exit
39+ Break
4040 }
4141 }
4242 Write-Host " Subscription selected." - ForegroundColor Green
@@ -57,7 +57,7 @@ function Load-VirtualNetwork {
5757 else
5858 {
5959 Write-Host " Virtual network not found." - ForegroundColor Red
60- Exit
60+ Break
6161 }
6262}
6363
@@ -78,7 +78,7 @@ function Load-VirtualNetworkSubnet {
7878 else
7979 {
8080 Write-Host " Subnet not found." - ForegroundColor Red
81- Exit
81+ Break
8282 }
8383}
8484
@@ -94,7 +94,7 @@ function Verify-Subnet {
9494 Else
9595 {
9696 Write-Host " Failed Validation - Minimum supported subnet size is /28." - ForegroundColor Red
97- Exit
97+ Break
9898 }
9999 If (
100100 ($subnet.IpConfigurations.Count -eq 0 ) -and
@@ -109,7 +109,7 @@ function Verify-Subnet {
109109 Else
110110 {
111111 Write-Host " Failed Validation - Subnet is already in use." - ForegroundColor Red
112- Exit
112+ Break
113113 }
114114}
115115
You can’t perform that action at this time.
0 commit comments