File tree Expand file tree Collapse file tree
samples/manage/azure-sql-db-managed-instance/attach-jumpbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ function LoadVirtualNetwork {
7878 If ($null -ne $virtualNetwork.Id )
7979 {
8080 Write-Host " Virtual network loaded." - ForegroundColor Green
81+ If ($virtualNetwork.VirtualNetworkPeerings.Count -gt 0 ) {
82+ Write-Host " Virtual should not have peerings." - ForegroundColor Red
83+ }
84+
8185 return $virtualNetwork
8286 }
8387 else
@@ -168,7 +172,7 @@ SelectSubscriptionId -subscriptionId $subscriptionId
168172$virtualNetwork = LoadVirtualNetwork - resourceGroupName $resourceGroupName - virtualNetworkName $virtualNetworkName
169173
170174$subnets = $virtualNetwork.Subnets.Name
171- Write-Host $subnets
175+
172176If ($false -eq $subnets.Contains ($managementSubnetName ))
173177{
174178 $managementSubnetPrefix = CalculateNextAddressPrefix $virtualNetwork 28
@@ -177,9 +181,9 @@ If($false -eq $subnets.Contains($managementSubnetName))
177181 Add-AzureRmVirtualNetworkSubnetConfig - Name $managementSubnetName - VirtualNetwork $virtualNetwork - AddressPrefix $managementSubnetPrefix | Out-Null
178182
179183 SetVirtualNetwork $virtualNetwork
180- Write-Host " Added subnet into VNet." - ForegroundColor Green
184+ Write-Host " Added subnet $managementSubnetName into VNet." - ForegroundColor Green
181185} else {
182- Write-Host " The subnet already exists in the VNet." - ForegroundColor Green
186+ Write-Host " The subnet $managementSubnetName already exists in the VNet." - ForegroundColor Green
183187}
184188
185189Write-Host
You can’t perform that action at this time.
0 commit comments