Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4267c2c
Merge pull request #12577 from Azure/master
isra-fel Aug 6, 2020
8176b1f
checking in changes
haagha Jul 29, 2020
6aba5db
Adding test recording with new param
haagha Aug 6, 2020
92a13e7
help.md file
haagha Aug 6, 2020
e2c20e1
added new AssignedHostGroup field in the objects
madewithsmiles Aug 6, 2020
56a8c05
updated changelog
madewithsmiles Aug 6, 2020
6447130
added test change
madewithsmiles Aug 6, 2020
4cbecfe
Fxing test
haagha Aug 6, 2020
f2058d8
updated tests to hit canary region
madewithsmiles Aug 6, 2020
0e76992
adding the new parameter
madewithsmiles Aug 6, 2020
7c6c13e
adding the actual subresource connected to the cmdlet parameter
madewithsmiles Aug 6, 2020
ad349cb
added dedicatedhostgroup strategy and overload getSubResourceReferenc…
madewithsmiles Aug 6, 2020
9daf36e
added tests for new parameter in vmss
madewithsmiles Aug 6, 2020
cf548ea
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
madewithsmiles Aug 6, 2020
3459eaa
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
madewithsmiles Aug 6, 2020
cf0fe3d
New-AzVm cmdlet dev and test work (#12595)
Sandido Aug 6, 2020
c81e789
New-AzVm hostgroupId help doc update
Sandido Aug 6, 2020
a78c607
Update VirtualMachineStrategy.cs
Sandido Aug 6, 2020
38d5b72
recorded test file for New-AzVm
Sandido Aug 7, 2020
0a1f010
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
haagha Aug 7, 2020
55b91aa
added call to new-azvm with hostgroup id for the test
madewithsmiles Aug 7, 2020
d4574c9
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
madewithsmiles Aug 7, 2020
03b7b0f
fixing testdedicatedhost
haagha Aug 7, 2020
9c0a8e6
New-AzVmss.md help doc
Sandido Aug 7, 2020
71897d6
added test for get-azvm -status returning AssignedHost
madewithsmiles Aug 9, 2020
bee3b18
added help description for the HostGroupId property for New-AzVmss
madewithsmiles Aug 9, 2020
ea30c17
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
madewithsmiles Aug 9, 2020
419bcf0
adding test + recording for new-azvmss .. -HostGroupId
madewithsmiles Aug 10, 2020
387ccca
Merge https://github.com/Azure/azure-powershell into vmssded
madewithsmiles Aug 10, 2020
ebee6a5
added the domain name label so the tests could pass in playback mode
madewithsmiles Aug 10, 2020
fc103bd
dedicated host changes for vmss
haagha Aug 10, 2020
8740f29
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
haagha Aug 10, 2020
27cf11d
added DomainNameLabel
Sandido Aug 10, 2020
f92082a
Revert "dedicated host changes for vmss"
haagha Aug 10, 2020
32c6f26
bringing back changes after revert
haagha Aug 10, 2020
0e6f0be
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
haagha Aug 10, 2020
0738d26
added new AssignedHostGroup field in the objects
madewithsmiles Aug 6, 2020
2c98de6
updated changelog
madewithsmiles Aug 6, 2020
0a19377
added test change
madewithsmiles Aug 6, 2020
1a092a9
updated tests to hit canary region
madewithsmiles Aug 6, 2020
0493f79
checking in changes
haagha Jul 29, 2020
9e53fac
Adding test recording with new param
haagha Aug 6, 2020
56acaef
help.md file
haagha Aug 6, 2020
3f352a1
adding the new parameter
madewithsmiles Aug 6, 2020
0160c68
adding the actual subresource connected to the cmdlet parameter
madewithsmiles Aug 6, 2020
5aedf36
added dedicatedhostgroup strategy and overload getSubResourceReferenc…
madewithsmiles Aug 6, 2020
a6d6cfd
added tests for new parameter in vmss
madewithsmiles Aug 6, 2020
c3b135a
New-AzVm cmdlet dev and test work (#12595)
Sandido Aug 6, 2020
da74e07
New-AzVm hostgroupId help doc update
Sandido Aug 6, 2020
e8350bf
Update VirtualMachineStrategy.cs
Sandido Aug 6, 2020
ae3c742
added call to new-azvm with hostgroup id for the test
madewithsmiles Aug 7, 2020
fa3cd3a
recorded test file for New-AzVm
Sandido Aug 7, 2020
9fa11cd
added test for get-azvm -status returning AssignedHost
madewithsmiles Aug 9, 2020
b8943b8
added help description for the HostGroupId property for New-AzVmss
madewithsmiles Aug 9, 2020
bc8a60a
Fxing test
haagha Aug 6, 2020
bc46653
fixing testdedicatedhost
haagha Aug 7, 2020
c4b2ecd
New-AzVmss.md help doc
Sandido Aug 7, 2020
ca73bb9
adding test + recording for new-azvmss .. -HostGroupId
madewithsmiles Aug 10, 2020
bdd7a7d
dedicated host changes for vmss
haagha Aug 10, 2020
80ca91f
added the domain name label so the tests could pass in playback mode
madewithsmiles Aug 10, 2020
d5aa29f
Revert "dedicated host changes for vmss"
haagha Aug 10, 2020
a0d932c
bringing back changes after revert
haagha Aug 10, 2020
b6cf7e5
added DomainNameLabel
Sandido Aug 10, 2020
a2f6712
added vmss tests and new recordings for the test
madewithsmiles Aug 11, 2020
09c27d3
better print for get-azhostgroup -instanceview
madewithsmiles Aug 11, 2020
33a3910
pulling changes
haagha Aug 13, 2020
fe82b44
Update ChangeLog.md
madewithsmiles Aug 18, 2020
4f7bb59
Adding ValueFromPipelineByPropertyName
madewithsmiles Aug 18, 2020
08abe7b
Making the HostGroupId accept pipeline input
madewithsmiles Aug 18, 2020
c4e1908
Merge branch 'VmssDedicatedHost' of https://github.com/Azure/azure-po…
haagha Aug 18, 2020
5b137ea
test dedicatedhost rerecorded
haagha Aug 18, 2020
b6cb52a
Update DedicatedHostTests.ps1
haagha Aug 19, 2020
d6e3319
Merge branch 'master' into VmssDedicatedHost
Aug 19, 2020
21e40ba
Removing plain text password
haagha Aug 20, 2020
129786a
fixing cred scan and psvmssinstanceview
haagha Aug 21, 2020
c6a11a9
Merge branch 'master' into VmssDedicatedHost
haagha Aug 21, 2020
9d78192
Updated help
haagha Aug 25, 2020
4f60f38
Update ChangeLog.md
madewithsmiles Aug 26, 2020
886a2d1
Update ChangeLog.md
madewithsmiles Aug 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/Compute/Compute.Test/ScenarioTests/DedicatedHostTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ function Test-DedicatedHost
try
{
# Common
[string]$loc = Get-ComputeVMLocation;
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
$loc = $loc.Replace(' ', '');

New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Create a VM first
$hostGroupName = $rgname + 'hostgroup'
New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 1 -Zone "1" -Tag @{key1 = "val1"};
New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 1 -Zone "2" -Tag @{key1 = "val1"};

$hostGroup = Get-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName;

Expand All @@ -40,15 +40,13 @@ function Test-DedicatedHost
Assert-AreEqual $loc $hostGroup.Location;
Assert-True { $hostGroup.Tags.Keys.Contains("key1") };
Assert-AreEqual "val1" $hostGroup.Tags["key1"];
Assert-True { $hostGroup.Zones.Contains("1") };
Assert-True { $hostGroup.Zones.Contains("2") };
Assert-AreEqual 0 $hostGroup.Hosts.Count;
Assert-AreEqual $true $hostGroup.SupportAutomaticPlacement;

$hostGroups = Get-AzHostGroup -ResourceGroupName $rgname;
Assert-AreEqual 1 $hostGroups.Count;

$hostGroups = Get-AzHostGroup;
Assert-True { $hostGroups.Count -ge 1 };

$hostName = $rgname + 'host'
New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku "ESv3-Type1" -Tag @{key1 = "val2"};

Expand Down Expand Up @@ -81,7 +79,7 @@ function Test-DedicatedHost

$hostGroupInstanceViewResult = Get-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -InstanceView;
Assert-NotNull $hostGroupInstanceViewResult.Hosts;
foreach ($hostInstanceViewWithName in $hostGroupInstanceViewResult.Hosts) {
foreach ($hostInstanceViewWithName in $hostGroupInstanceViewResult.InstanceView.Hosts) {
Assert-NotNull $hostInstanceViewWithName.Name;
}

Expand Down Expand Up @@ -129,15 +127,18 @@ function Test-DedicatedHostVirtualMachine
try
{
# Common
[string]$loc = Get-ComputeVMLocation;
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
$loc = $loc.Replace(' ', '');

New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Create a VM first
$hostGroupName = $rgname + 'hostgroup'
New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone "1" -Tag @{key1 = "val1"};

New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone "2" -SupportAutomaticPlacement $false -Tag @{key1 = "val1"};
$hostGroup = Get-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName;

Assert-AreEqual $false $hostGroup.SupportAutomaticPlacement;

$hostName = $rgname + 'host'
New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku "ESv3-Type1" -PlatformFaultDomain 1 -Tag @{key1 = "val2"};

Expand All @@ -154,7 +155,7 @@ function Test-DedicatedHostVirtualMachine
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
[string]$domainNameLabel = "$vmname0-$vmname0".tolower();

New-AzVM -ResourceGroupName $rgname -Name $vmname0 -Credential $cred -Zone "1" -Size $vmsize -HostId $dedicatedHostId -DomainNameLabel $domainNameLabel;
New-AzVM -ResourceGroupName $rgname -Name $vmname0 -Credential $cred -Zone "2" -Size $vmsize -HostId $dedicatedHostId -DomainNameLabel $domainNameLabel;
$vm0 = Get-AzVM -ResourceGroupName $rgname -Name $vmname0;
Assert-AreEqual $dedicatedHostId $vm0.Host.Id;

Expand All @@ -164,7 +165,7 @@ function Test-DedicatedHostVirtualMachine
$subnet = New-AzVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
$vnet = New-AzVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
$subnetId = $vnet.Subnets[0].Id;
$pubip = New-AzPublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -Zone "1" -Sku "Standard" -AllocationMethod "Static" -DomainNameLabel ('pubip' + $rgname);
$pubip = New-AzPublicIpAddress -Force -Name ('pubip' + $rgname) -ResourceGroupName $rgname -Location $loc -Zone "2" -Sku "Standard" -AllocationMethod "Static" -DomainNameLabel ('pubip' + $rgname);
$pubipId = $pubip.Id;
$nic = New-AzNetworkInterface -Force -Name ('nic' + $rgname) -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -PublicIpAddressId $pubip.Id;
$nicId = $nic.Id;
Expand All @@ -176,7 +177,7 @@ function Test-DedicatedHostVirtualMachine
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);
$computerName = 'test';

$p = New-AzVMConfig -VMName $vmname1 -VMSize $vmsize -Zone "1" -HostId $dedicatedHostId `
$p = New-AzVMConfig -VMName $vmname1 -VMSize $vmsize -Zone "2" -HostId $dedicatedHostId `
| Add-AzVMNetworkInterface -Id $nicId -Primary `
| Set-AzVMOperatingSystem -Windows -ComputerName $computerName -Credential $cred;

Expand Down
7 changes: 7 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public void TestSimpleNewVmssPpg()
TestRunner.RunTestScript("Test-SimpleNewVmssPpg");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSimpleNewVmssHostGroup()
{
TestRunner.RunTestScript("Test-SimpleNewVmssHostGroup");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSimpleNewVmssBilling()
Expand Down
44 changes: 44 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,50 @@ function Test-SimpleNewVmssPpg
}
}

<#
.SYNOPSIS
Test Simple Paremeter Set With HostGroup (automatic placement)
#>
function Test-SimpleNewVmssHostGroup
{
# Setup
$rgname = Get-ResourceName

try
{
# Common
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
$loc = $loc.Replace(' ', '');
$zone = "2"

# Creating the resource group
New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Hostgroup and Host
$hostGroupName = $rgname + "HostGroup"
$hostGroup = New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone $zone -SupportAutomaticPlacement $true -Tag @{key1 = "val1"};

$Sku = "Dsv3-Type1"
$hostName = $rgname + "Host"
New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku $Sku -PlatformFaultDomain 1 -Tag @{test = "true"}

# Creating a new vmss
$VmSku = "Standard_D2s_v3"
$vmssname = "MyVmss"
$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$vmss = New-AzVmss -Name $vmssname -ResourceGroup $rgname -Credential $cred -HostGroupId $hostGroup.Id -Zone $zone -VmSize $VmSku -DomainNameLabel "myvmss-48e3cf"

Assert-AreEqual $vmss.HostGroup.Id $hostGroup.Id
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Simple Paremeter Set for New Vmss with eviction policy, priority, and max price.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,12 @@ public void TestVirtualMachineScaleSetNewEncryptionAtHost()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetEncryptionAtHost");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineScaleSetAssignedHost()
{
TestRunner.RunTestScript("Test-VirtualMachineScaleSetAssignedHost");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2536,3 +2536,50 @@ function Test-VirtualMachineScaleSetEncryptionAtHost
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
testing encryptionAtHost cmdlet for
new-azvmss - create vmss using simple parameter set and hostencryption tag.
update-azvmss test boolean parameter
new-azvmssconfig
#>
function Test-VirtualMachineScaleSetAssignedHost
{
# Setup
$rgname = Get-ComputeTestResourceName

try
{
# Common
$zone = "2"
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Hostgroup and Host
$hostGroupName = $rgname + "HostGroup"
$hostGroup = New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone $zone -SupportAutomaticPlacement $true -Tag @{key1 = "val1"};

$Sku = "Esv3-Type1"
$hostName = $rgname + "Host"
$host_ = New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku $Sku -PlatformFaultDomain 1 -Tag @{test = "true"}

# Creating a new vmss
$VmSku = "Standard_E2s_v3"
$domainNameLabel = "domainlabel"
$vmssname = "MyVmss"
$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$vmss = New-AzVmss -Name $vmssname -ResourceGroup $rgname -Credential $cred -HostGroupId $hostGroup.Id -Zone $zone -VmSize $VmSku -DomainNameLabel $domainNameLabel

$vmssResult = Get-AzVmssVM -InstanceView -ResourceGroupName $rgname -VMScaleSetName $vmssname;

Assert-AreEqual $host_.Id $vmssResult[0].InstanceView.AssignedHost;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}
14 changes: 14 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ public void TestVirtualMachineGetStatus()
TestRunner.RunTestScript("Test-VirtualMachineGetStatus");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineGetStatusWithAssignedHost()
{
TestRunner.RunTestScript("Test-VirtualMachineGetStatusWithAssignedHost");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestVirtualMachineManagedDiskConversion()
Expand Down Expand Up @@ -311,5 +318,12 @@ public void TestSetAzVMOperatingSystemError()
{
TestRunner.RunTestScript("Test-SetAzVMOperatingSystemError");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestHostGroupPropertySetOnVirtualMachine()
{
TestRunner.RunTestScript("Test-HostGroupPropertySetOnVirtualMachine");
}
}
}
96 changes: 96 additions & 0 deletions src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2994,6 +2994,57 @@ function Test-VirtualMachineGetStatus
}
}

<#
.SYNOPSIS
Test Virtual Machines
#>
function Test-VirtualMachineGetStatusWithAssignedHost
{
param ($loc)
# Setup
$rgname = Get-ComputeTestResourceName

try
{
# Common
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
$loc = $loc.Replace(' ', '');

# Creating the resource group
New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Hostgroup and Hostgroupname
$hostGroupName = $rgname + "HostGroup"
$hostGroup = New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone "2" -SupportAutomaticPlacement $true -Tag @{key1 = "val1"};


$Sku = "Esv3-Type1"
$hostName = $rgname + "Host"
New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku $Sku -PlatformFaultDomain 1 -Tag @{test = "true"}

# VM Profile & Hardware
$vmsize = 'Standard_E2s_v3';
$vmname = $rgname + 'Vm';

# Creating a VM using simple parameter set
$user = "Foo2";
$password = Get-PasswordForVM
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);

New-AzVM -ResourceGroupName $rgname -Location $loc -Name $vmname -Credential $cred -Zone "2" -Size $vmsize -DomainNameLabel "crptestps2532vm-1d1de" -HostGroupId $hostGroup.Id;
$vm = Get-AzVM -ResourceGroupName $rgname -Name $vmname -Status
$a = $vm | Out-String

Assert-True {$a.Contains("AssignedHost")};
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test Virtual Machine managed disk conversion
Expand Down Expand Up @@ -4171,3 +4222,48 @@ function Test-SetAzVMOperatingSystemError
}
}

<#
.SYNOPSIS
Test HostGroup property is set on a VM correctly when HostGroup.Id is passed as a parameter.
#>
function Test-HostGroupPropertySetOnVirtualMachine
{
# Setup
$rgname = Get-ComputeTestResourceName

try
{
# Common
[string]$loc = Get-Location "Microsoft.Resources" "resourceGroups" "East US 2 EUAP";
$loc = $loc.Replace(' ', '');

New-AzResourceGroup -Name $rgname -Location $loc -Force;

# Create a VM first
$hostGroupName = $rgname + 'hostgroup'
$hostGroup = New-AzHostGroup -ResourceGroupName $rgname -Name $hostGroupName -Location $loc -PlatformFaultDomain 2 -Zone "2";

$hostName = $rgname + 'host'
New-AzHost -ResourceGroupName $rgname -HostGroupName $hostGroupName -Name $hostName -Location $loc -Sku "ESv3-Type1" -PlatformFaultDomain 1;

# VM Profile & Hardware
$vmsize = 'Standard_E2s_v3';
$vmname0 = 'v' + $rgname;

# Creating a VM using simple parameter set
$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
[string]$domainNameLabel = "vcrptestps7691-6f2166";

$vm0 = New-AzVM -ResourceGroupName $rgname -Location $loc -Name $vmname0 -Credential $cred -Zone "2" -Size $vmsize -HostGroupId $hostGroup.Id -DomainNameLabel $domainNameLabel;

Assert-AreEqual $hostGroup.Id $vm0.HostGroup.Id;
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

Loading