Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Hyper-V PowerShell

Direct 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.

When to use this

Use this when using the Hyper-V PowerShell module.

First 30 seconds

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.

Operational verification

cmdlets → VMMS on hosts

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Hyper-V PowerShell automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformHyper-V PowerShell automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when using the Hyper-V PowerShell module.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • Cmdlets like New-VM, Get-VM, Set-VM, Move-VM.
  • -ComputerName for remote hosts.
  • Objects can be piped.
Key checks
  • Get-Module Hyper-V -ListAvailable — module
  • Get-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.

AreaCmdlets
VMsNew-VM, Get-VM, Set-VM, Start-VM, Stop-VM
DisksNew-VHD, Resize-VHD, Add-VMHardDiskDrive
NetworkingNew-VMSwitch, Set-VMNetworkAdapterVlan
CheckpointsCheckpoint-VM, Remove-VMSnapshot
ReplicationEnable-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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docHyper-V PowerShell automation current

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%
Depth when you need it

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.

Confirmation

Confirm action

Continue?