dump/Windows/Hyper-V
2024-07-30 23:57:03 -05:00

26 lines
885 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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