Use this when using the Hyper-V PowerShell module.
Hyper-V PowerShell
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.
1. Hyper-V module manages hosts, VMs, switches, disks.
2. Run remotely.
3. Combine with FailoverClusters module for clustered VMs.
4. Version differences between Windows releases.
5. Test scripts.
cmdlets → VMMS on hosts
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Record host/cluster, VM ID/name, VHDX path/ID, switch/adapter IDs and operation/job identity; inspect the runtime/control-plane result; then query the Hyper-V VM and its storage/network/replication state through an independent read path and compare it with the versioned intent. The negative fixture should deliberately exercise risks such as name collisions, cluster ownership changes, path/capacity mismatch, checkpoints/locks, asynchronous completion, replication lag and host success without guest/application success, choosing the cases most relevant to Hyper-V cmdlet object identity, host context, asynchronous operations, WhatIf/support limits and post-operation Get-* read-back. For Hyper-V Automation → Hyper-V PowerShell, the evidence must connect the control-plane result to the Hyper-V VM and its storage/network/replication state and explain any gap between desired, controller-reported and consumer-visible state.
Step 2 Common mistakes Narrow the fault
- Running Hyper-V cmdlets without the Hyper-V module on the admin host.
Step 3 Where it fails Narrow the fault
Common failure classes include name collisions, cluster ownership changes, path/capacity mismatch, checkpoints/locks, asynchronous completion, replication lag and host success without guest/application success. Before retrying a mutating operation, read current target state using the stable identity host/cluster, VM ID/name, VHDX path/ID, switch/adapter IDs and operation/job identity; if state is unknown, stop broad retries.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Cmdlets like New-VM, Get-VM, Set-VM, Move-VM.
- -ComputerName for remote hosts.
- Objects can be piped.
Get-Module Hyper-V -ListAvailable— moduleGet-VM | ft Name,State— basic query- Use -ComputerName/-CimSession for remote — scale
ReferenceWhy it matters1 section · depth on demand
In depth
The Hyper-V PowerShell module exposes every Hyper-V operation as cmdlets — VMs, switches, disks, checkpoints, replication — making Hyper-V fully scriptable.
| Area | Cmdlets |
|---|---|
| VMs | New-VM, Get-VM, Set-VM, Start-VM, Stop-VM |
| Disks | New-VHD, Resize-VHD, Add-VMHardDiskDrive |
| Networking | New-VMSwitch, Set-VMNetworkAdapterVlan |
| Checkpoints | Checkpoint-VM, Remove-VMSnapshot |
| Replication | Enable-VMReplication |
Get-VM -ComputerName hv01, hv02 | Where-Object State -eq 'Running' | Select Name, CPUUsage, MemoryAssigned
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Hyper-V Automation → Hyper-V PowerShell is owned at runtime by Hyper-V VMMS/hypervisor services invoked through the Hyper-V PowerShell/API surface. Its durable intent is versioned VM, virtual disk, network, replication or migration specification; the stable identity contract is host/cluster, VM ID/name, VHDX path/ID, switch/adapter IDs and operation/job identity. The consumer-visible target is the Hyper-V VM and its storage/network/replication state. The operating invariants are that VM identity is unambiguous, host/cluster ownership is current, storage/network dependencies are validated, asynchronous jobs reach terminal state and guest/consumer state is checked when relevant. Follow the chain of components PowerShell/API request → VMMS/cluster control plane → hypervisor/storage/network operation → VM state → guest/target read-back and record which layer currently owns truth. The linked authority for bounded mechanics is Microsoft Learn — Hyper-V PowerShell module; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hyper-V Automation > Hyper-V PowerShell. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/module/hyper-v/?view=windowsserver2025-ps · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum host/cluster, VM ID/name, operation/job ID, state/status, VHDX/switch/adapter IDs, migration/replication health, errors and guest/target verification. For Hyper-V cmdlet object identity, host context, asynchronous operations, WhatIf/support limits and post-operation Get-* read-back, prefer typed fields and stable IDs over human presentation text.