Scripts/HyperV.ps1


Set-VMProcessor -VMName HV01 -ExposeVirtualizationExtensions $true



$VMName = "MDT01"
$DriveLetter = "D"
$Size = "50GB"

$Path = "G:\Hyper-V\MDT01\Virtual Hard Disks"
Set-Location $Path

New-VHD -Path "$($VMName)-$($DriveLetter).vhdx" -SizeBytes $Size #-Fixed

Add-VMHardDiskDrive -VMName $VMName -Path "$($VMName)-$($DriveLetter).vhdx"

Get-VMHardDiskDrive -VMName $VMName



# Use Windows Powershell!!!

Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-Tools-All -NoRestart -Online -All



# Add VM adapter to host
Add-VMNetworkAdapter -ManagementOS -SwitchName AP