Compares a virtual machine and a virtual machine host for compatibility, returning a compatibility report.
Windows Server · Risk: Low · Documentation Verified
Last verified: 2026-10-26
Microsoft Hyper-V reference: Compares a virtual machine and a virtual machine host for compatibility, returning a compatibility report. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Compare-VM. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / Hyper-V · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-AsJob
Runs the cmdlet as a background job.
-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
-CompatibilityReport (required)
Specifies a compatibility report which resolves any incompatibilities between the virtual machine and the virtual machine host.
-ComputerName
Specifies one or more Hyper-v hosts that run this cmdlet. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.
-Confirm
Prompts you for confirmation before running the cmdlet.
-Copy (required)
Specifies that the comparison should be made for a copy import operation.
-Credential
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
-DestinationCimSession (required)
Specifies the CIMSession on the Hyper-V host to which this cmdlet compares the virtual machine for compatibility.
-DestinationCredential
Specifies a user account that has permission to perform this action. The default is the current user.
-DestinationHost (required)
Specifies the Hyper-V host to which the virtual machine is to be compared for compatibility.
-DestinationStoragePath
Specifies a destination storage path to which all virtual machine storage is to be moved.
-GenerateNewId
Specifies that the virtual machine should be copied and given a new unique identifier.
-IncludeStorage
Specifies that the compatibility comparison should include both the virtual machine and its storage.
-Name (required)
Specifies the name of the virtual machine to be compared.
-Path (required)
Specifies the path to the configuration file of the virtual machine to be compared.
-Register
Specifies that the comparison should be made for an in-place import operation.
-ResourcePoolName
Specifies the friendly name of the resource pool.
-RetainVhdCopiesOnSource
Indicates that this cmdlet retains parent virtual hard disks on the source computer.
-SmartPagingFilePath
Specifies the new path to use for a smart paging file, if one is needed.
-SnapshotFilePath
Specifies the path for any snapshot files associated with the virtual machine.
-VM (required)
Specifies a virtual machine.
-VhdDestinationPath
Specifies the folder to which the virtual machine's VHD is to be copied.
-VhdSourcePath
Specifies the folder from which the virtual machine's VHD files are to be copied.
-Vhds
Specifies an array of hash tables that specifies a location for each individual virtual hard disk that needs to be compared. Each hash table has two entries. The first entry specifies the current location of the virtual hard disk to move, and has a key of SourceFilePath. The second entry specifies the new location for the virtual hard disk, and has a key of DestinationFilePath. The virtual hard disk names must be identical in both entries.
-VirtualMachinePath (required)
Specifies the path where the resulting virtual machine configuration files are to be stored.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the Hyper-V module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This is a read-oriented cmdlet; protect any sensitive results and check the documented effects of your selected parameters.
Compares virtual machine TestVM and Hyper-V host TestDestinationHost for compatibility. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.