Hyper-V PowerShell Management Cheat Sheet¶
PowerShell commands to spin up and manage Hyper-V virtual machines.
Note: Ensure you run these in a PowerShell window with Administrator privileges.
Hyper-V VM Management¶
List All VMs:
Start a VM:
Stop a VM (Shut down):
Turn Off (Hard Reset):
Restart a VM:
Suspend (Pause) VM:
Resume VM:
Rename a VM:
Remove/Delete VM:
Configuration & Hardware¶
Show VM Settings:
Set Memory (Static):
Set CPU Count:
Enable Dynamic Mem:
List Network Adapters:
Connect ISO/DVD:
Snapshots (Checkpoints)¶
Create Checkpoint:
List Checkpoints:
Apply Checkpoint:
Delete Checkpoint:
Virtual Networking (V-Switches)¶
List All Switches:
Create External Switch:
Create Private Switch:
Connect VM to Switch:
Virtual Disks (VHD/VHDX)¶
Create New Disk:
Mount VHD to Host:
Expand Disk Size:
Get Disk Info:
Quick Diagnostics¶
- Is Hyper-V enabled?
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V - Check VM Uptime:
Get-VM | Select Name, State, Uptime - Expose Virtualization (Nested VT): If you want to run Proxmox or Docker inside a Hyper-V VM, run:
Set-VMProcessor -VMName "[VMName]" -ExposeVirtualizationExtensions $true