dump/Windows/Hyper-V

26 lines
885 B
Plaintext
Raw Normal View History

2024-07-30 23:57:03 -05:00
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
#reboot
New-VMSwitch -name ExternalSwitch -NetAdapterName Ethernet -AllowManagementOS $true
$vms = @{
Name = 'rmote1'
Generation = '2'
MemoryStartupBytes = 4GB
NewVHDPath = 'D:\VMs\rmote1\rmote1.vhdx'
NewVHDSizeBytes = 127GB
SwitchName = 'ExternalSwitch'
}
New-VM @vms
Add-VMDvdDrive `
-VMName $vms.Name `
-Path C:\Users\keplradmin\Documents\Windows.iso
Set-VM -VMName $vms.Name AutomaticStartAction Start
Set-VM -Name $vms.Name -AutomaticStopAction Shutdown
Set-VMProcessor -VMName $vms.Name -Count 4
Set-VMMemory -VMName $vms.Name -DynamicMemoryEnabled $true -MinimumBytes 4GB -StartupBytes 4GB -MaximumBytes 8GB -Priority 50 -Buffer 20
Set-VMFirmware -VMName $vms.Name `
-FirstBootDevice ((Get-VMFirmware -VMName $vms.Name).BootOrder |
Where-Object Device -like *DvD*).Device