Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2021 16:48
What would you like to do?
Create VM with iso OS
$Switch='Default Switch',
New-VM -Name $VMName –NewVHDPath $NewVHD -MemoryStartupBytes $Memory -NewVHDSizeBytes $VHDSize
ADD-VMNetworkAdapter –VMName $VMName –Switchname $Switch
SET-VMProcessor –VMName $VMName –Count 2
Set-VMDvdDrive -VMName $VMName -ControllerNumber 1 -Path $IsoPath
#New-VM -Name "vs vm" –NewVHDPath 'D:\Hyper-V\Virtual Hard Disks\vsvm.vhdx' -MemoryStartupBytes 1GB -NewVHDSizeBytes 40GB
#ADD-VMNetworkAdapter –VMName 'vs vm' –Switchname "Default Switch"
#SET-VMProcessor –VMName “vs vm” –Count 2
#Set-VMDvdDrive -VMName 'vs vm' -ControllerNumber 1 -Path "D:\iso\Windows.iso"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment