Automation · Hyper-V Automation
Hyper-V PowerShell
Cheat sheet · https://pcornel.dk/topic.php?topic=5709
Answer
The Hyper-V PowerShell module provides cmdlets like New-VM, Get-VM, Set-VM, Start-VM and Move-VM for managing VMs locally or with -ComputerName on remote hosts.
Remember
- Cmdlets like New-VM, Get-VM, Set-VM, Move-VM.
- -ComputerName for remote hosts.
- Objects can be piped.
First checks
Get-Module Hyper-V -ListAvailable— moduleGet-VM | ft Name,State— basic query- Use -ComputerName/-CimSession for remote — scale
Verify in this order
cmdlets → VMMS on hosts
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5709