@@ -142,7 +142,9 @@ function Get-DeleteAndCreateTestNetworkWatcher($location, $nwName, $nwRgName, $t
142
142
# Delete Network Watcher if existing nw
143
143
if ($nw )
144
144
{
145
- Remove-AzureRmNetworkWatcher - NetworkWatcher $nw
145
+ $job = Remove-AzureRmNetworkWatcher - NetworkWatcher $nw - AsJob
146
+ $job | Wait-Job
147
+ $delete = $job | Receive-Job
146
148
}
147
149
148
150
$nw = New-AzureRmNetworkWatcher - Name $nwName - ResourceGroupName $nwRgName - Location $location - Tag $tags
@@ -499,7 +501,7 @@ function Test-Troubleshoot
499
501
# Setup
500
502
$resourceGroupName = Get-ResourceGroupName
501
503
$nwName = Get-ResourceName
502
- $location = " centraluseuap "
504
+ $location = " westus "
503
505
$resourceTypeParent = " Microsoft.Network/networkWatchers"
504
506
$nwLocation = Get-ProviderLocation $resourceTypeParent
505
507
$nwRgName = Get-ResourceGroupName
@@ -572,7 +574,7 @@ function Test-FlowLog
572
574
$nwName = Get-ResourceName
573
575
# Since Traffic Analytics is not available in all Azure regions, hardcoded locations are used
574
576
# Once Traffic Analytics is available in all Azure regions, the below two location variables should be updated to Get-Location
575
- $location = " eastus2euap "
577
+ $location = " westcentralus "
576
578
$workspaceLocation = " eastus"
577
579
$resourceTypeParent = " Microsoft.Network/networkWatchers"
578
580
$nwLocation = Get-ProviderLocation $resourceTypeParent
@@ -723,18 +725,16 @@ function Test-ReachabilityReport
723
725
# Setup
724
726
$rgname = Get-ResourceGroupName
725
727
$nwName = Get-ResourceName
726
- $rglocation = Get-ProviderLocation ResourceManagement
727
728
$resourceTypeParent = " Microsoft.Network/networkWatchers"
728
729
$location = " westus"
729
730
730
731
try
731
732
{
732
733
# Create the resource group
733
- $resourceGroup = New-AzureRmResourceGroup - Name $rgname - Location $rglocation - Tags @ { testtag = " testval" }
734
-
735
- # Create the Network Watcher
736
- $tags = @ {" key1" = " value1" ; " key2" = " value2" }
737
- $nw = Get-DeleteAndCreateTestNetworkWatcher - location $location - nwName $nwName - nwRgName $rgname - tags $tags
734
+ $resourceGroup = New-AzureRmResourceGroup - Name $rgname - Location $location - Tags @ { testtag = " testval" }
735
+
736
+ # Get Network Watcher
737
+ $nw = Get-CreateTestNetworkWatcher - location $location - nwName $nwName - nwRgName $rgName
738
738
739
739
$job = Get-AzureRmNetworkWatcherReachabilityReport - NetworkWatcher $nw - Location " West US" - Country " United States" - StartTime " 2017-10-05" - EndTime " 2017-10-10" - AsJob
740
740
$job | Wait-Job
@@ -768,18 +768,16 @@ function Test-ProvidersList
768
768
# Setup
769
769
$rgname = Get-ResourceGroupName
770
770
$nwName = Get-ResourceName
771
- $rglocation = Get-ProviderLocation ResourceManagement
772
771
$resourceTypeParent = " Microsoft.Network/networkWatchers"
773
- $location = " westcentralus "
772
+ $location = " westus "
774
773
775
774
try
776
775
{
777
776
# Create the resource group
778
- $resourceGroup = New-AzureRmResourceGroup - Name $rgname - Location $rglocation - Tags @ { testtag = " testval" }
779
-
780
- # Create the Network Watcher
781
- $tags = @ {" key1" = " value1" ; " key2" = " value2" }
782
- $nw = Get-DeleteAndCreateTestNetworkWatcher - location $location - nwName $nwName - nwRgName $rgname - tags $tags
777
+ $resourceGroup = New-AzureRmResourceGroup - Name $rgname - Location $location - Tags @ { testtag = " testval" }
778
+
779
+ # Get Network Watcher
780
+ $nw = Get-CreateTestNetworkWatcher - location $location - nwName $nwName - nwRgName $rgname
783
781
784
782
$job = Get-AzureRmNetworkWatcherReachabilityProvidersList - NetworkWatcher $nw - Location " West US" - Country " United States" - AsJob
785
783
$job | Wait-Job
@@ -881,20 +879,8 @@ function Test-ConnectionMonitor
881
879
# Query connection monitor
882
880
Get-AzureRmNetworkWatcherConnectionMonitorReport - NetworkWatcher $nw - Name $cmName1
883
881
884
- # Get connection monitor list
885
- $cmList = Get-AzureRmNetworkWatcherConnectionMonitor - NetworkWatcher $nw
886
-
887
- # Validation
888
- Assert-AreEqual $cmList.Count 2
889
-
890
882
# Remove connection monitor
891
883
Remove-AzureRmNetworkWatcherConnectionMonitor - NetworkWatcher $nw - Name $cmName1
892
-
893
- # Get connection monitor list
894
- $cmList = Get-AzureRmNetworkWatcherConnectionMonitor - NetworkWatcher $nw
895
-
896
- # Validation
897
- Assert-AreEqual $cmList.Count 1
898
884
}
899
885
finally
900
886
{
0 commit comments