Windows Server · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft Hyper-V reference: Adds a hard disk drive to a virtual machine. 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 Add-VMHardDiskDrive. 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
-AllowUnverifiedPaths
Specifies that no error is to be thrown if the specified path is not verified as accessible by the cluster. This parameter is applicable to clustered virtual machines.
-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.
-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.
-ControllerLocation
Specifies the number of the location on the controller at which the hard disk drive is to be added. If not specified, the first available location in the controller specified with the ControllerNumber parameter is used.
-ControllerNumber
Specifies the number of the controller to which the hard disk drive is to be added. If not specified, this parameter assumes the value of the first available controller at the location specified in the ControllerLocation parameter.
-ControllerType
Specifies the type of the controller to which the hard disk drive is to be added. If not specified, IDE is attempted first. If the IDE controller port at the specified number and location is already connected to a drive, then it will try to create one on the SCSI controller specified by ControllerNumber. Allowed values are IDE and SCSI.
-Credential
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
-DiskNumber
Specifies the disk number of the offline physical hard drive to be connected as a passthrough disk.
-MaximumIOPS
Specifies the maximum normalized I/O operations per second (IOPS) for the hard disk. Hyper-V calculates normalized IOPS as the total size of I/O per second divided by 8 KB.
-MinimumIOPS
Specifies the minimum normalized I/O operations per second (IOPS) for the hard disk. Hyper-V calculates normalized IOPS as the total size of I/O per second divided by 8 KB.
-Passthru
Passes the added Microsoft.HyperV.PowerShell.HardDiskDrive object through to the pipeline.
-Path
Specifies the full path of the hard disk drive file to be added.
-QoSPolicy
Specifies the name of the storage Quality of Service (QoS) policy that this cmdlet associates with the hard disk drive.
-QoSPolicyID
Specifies the unique ID for a storage QoS policy that this cmdlet associates with the hard disk drive.
-ResourcePoolName
Specifies the friendly name of the ISO resource pool to which this virtual hard disk is to be associated.
-SupportPersistentReservations
Indicates that the hard disk supports SCSI persistent reservation semantics. Specify this parameter when the hard disk is a shared disk that is used by multiple virtual machines.
-VM (required)
Specifies the virtual machine to which the hard disk drive is to be added.
-VMDriveController (required)
Specifies the controller to which the hard disk drive is to be added.
-VMName (required)
Specifies the name of the virtual machine to which the hard disk drive is to be added.
-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 cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
Examples
Example 1
Add-VMHardDiskDrive -VMName Test -Path D:\VHDs\disk1.vhdx
Creates a virtual hard disk using file D:\VHDs\disk1.vhdx on virtual machine Test. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.