Forum Discussion
Yojana0787
Feb 21, 2023Copper Contributor
Error while running New-VHD cmdlet on Windows Server 2019
Hi, I am trying to create an empty .vhd file using the PowerShell cmdlet New-VHD on Windows Server 2019 virtual machine hosted on Hyper-V. I am seeing the attached error while running the cmdlet: ...
Jamony
Sep 18, 2026MCT
New-VHD comes from the Hyper-V PowerShell module.
Check whether the cmdlet and module are installed:
Get-Command New-VHD -ErrorAction SilentlyContinue
Get-Module -ListAvailable Hyper-V
If the module is missing:
Install-WindowsFeature Hyper-V-PowerShell
Then reopen an elevated PowerShell session and test:
New-VHD -Path C:\VMs\Test.vhdx -Dynamic -SizeBytes 20GB
Make sure the destination folder exists and that your account has write permissions.
You don't need nested virtualization simply to create a VHD/VHDX file.