@@ -21,46 +21,32 @@ function Test-ExpressRouteCircuitStageCRUD
21
21
# Setup
22
22
$rgname = ' movecircuit'
23
23
$circuitName = Get-ResourceName
24
- $rglocation = Get-ProviderLocation ResourceManagement
24
+ $rglocation = " westus "
25
25
$resourceTypeParent = " Microsoft.Network/expressRouteCircuits"
26
- $location = Get-ProviderLocation $resourceTypeParent
27
26
$location = " westus"
28
27
try
29
28
{
30
29
# Create the resource group
31
30
$resourceGroup = New-AzureRmResourceGroup - Name $rgname - Location $rglocation
32
31
33
32
# Create the ExpressRouteCircuit
34
- $circuit = New-AzureRmExpressRouteCircuit - Name $circuitName - Location $location - ResourceGroupName $rgname - SkuTier Standard - SkuFamily MeteredData - ServiceProviderName " equinix test" - PeeringLocation " Silicon Valley Test" - BandwidthInMbps 50 - AllowClassicOperations $true ;
33
+ $circuit = New-AzureRmExpressRouteCircuit - Name $circuitName - Location $location - ResourceGroupName $rgname - SkuTier Standard - SkuFamily MeteredData - ServiceProviderName " equinix test" - PeeringLocation " Silicon Valley Test" - BandwidthInMbps 50 - AllowClassicOperations $true ;
35
34
36
- # get Circuit
37
- $getCircuit = Get-AzureRmExpressRouteCircuit - Name $circuitName - ResourceGroupName $rgname
38
-
39
- # verification
40
- Assert-AreEqual $rgName $getCircuit.ResourceGroupName
41
- Assert-AreEqual $circuitName $getCircuit.Name
42
- Assert-NotNull $getCircuit.Location
43
- Assert-NotNull $getCircuit.Etag
44
- Assert-AreEqual 0 @ ($getCircuit.Peerings ).Count
45
- Assert-AreEqual " Standard_MeteredData" $getCircuit.Sku.Name
46
- Assert-AreEqual " Standard" $getCircuit.Sku.Tier
47
- Assert-AreEqual " MeteredData" $getCircuit.Sku.Family
48
-
49
-
50
- # set
51
- $getCircuit.AllowClassicOperations = $false
52
-
53
- $getCircuit = Set-AzureRmExpressRouteCircuit - ExpressRouteCircuit $getCircuit
35
+ $circuit = Get-AzureRmExpressRouteCircuit - Name $circuitName - ResourceGroupName $rgname
36
+ # set
37
+ $circuit.AllowClassicOperations = $false
38
+ $circuit = Set-AzureRmExpressRouteCircuit - ExpressRouteCircuit $circuit
54
39
55
40
# move
56
- Move-AzureRmExpressRouteCircuit - Name - ResourceGroupName - Location - ServiceKey
41
+ Move-AzureRmExpressRouteCircuit - Name $circuitName - ResourceGroupName $rgname - Location $location - ServiceKey $circuit .ServiceKey - Force
57
42
58
43
# Delete Circuit
59
44
$delete = Remove-AzureRmExpressRouteCircuit - ResourceGroupName $rgname - name $circuitName - PassThru - Force
60
45
Assert-AreEqual true $delete
61
46
62
47
$list = Get-AzureRmExpressRouteCircuit - ResourceGroupName $rgname
63
48
Assert-AreEqual 0 @ ($list ).Count
49
+
64
50
}
65
51
finally
66
52
{
0 commit comments