Last active
June 1, 2018 17:57
-
-
Save staybuzz/1dea20444018034b1e0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################## | |
# Create Virtual Distributed PortGroup | |
# VLAN 20 - 160 | |
20..160 | foreach { | |
Get-VDSwitch -Name "test" | New-VDPortgroup -Name ("VLAN{0:0}" -F $_) -NumPorts 15 -VLanId $_ | |
} | |
# Create VM from Template | |
1...15 | foreach { | |
New-VM -Name ("T{0:0}mori_common" -F $_) -Datastore 'datastore1' -Template common-Template -ResourcePool Resources -DiskStorageFormat thin | |
} | |
# Set PortGroup to VM | |
Get-VM -Name T1mori_common | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName VLAN160 -RunAsync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment