hyper-v powershell 开通虚拟机,配置vlan,配置CPU,内存

for($i=101;$i -lt 111;$i=$i+1)
{
copy-item d:\hyper-v\vhd\111.vhdx  d:\hyper-v\vhd\${i}.vhdx
new-vm ${i}server
set-vm -name ${i}server -AutomaticStopAction Shutdown -ProcessorCount  12 -MemoryStartupBytes 7GB
Add-VMHardDiskDrive -VMName ${i}server -Path d:\hyper-v\vhd\${i}.vhdx
Set-VMNetworkAdapterVlan -VMName ${i}server -Access -VlanId $i

}

 

posted @ 2020-07-31 20:35  嗷嗷鹿鸣[VX|dshoub]  阅读(507)  评论(0编辑  收藏  举报