PowerShell New-VHD will not take VolumeID as Path argument RRS feed

  • Question

  •  New-VHD -SizeBytes 16GB -Fixed -Path '\\?\Volume{a3d75r32-1fbf-46fa-ac84-795c1dm9afe2}\TMP.vhdx'

    It's interpreted as a relative path.

    New-VHD : Failed to create the virtual hard disk.
    The system failed to create 'C:\\?\Volume{...}\TMP.vhdx': The filename, directory name, or volume label syntax is incorrect.

    If I use quotes: "VolumeID" the error is Illegal characters in path.

    VolumeID works like a champ in Hyper-V manager.  I enter the VolumeID in the "Location field" in the New Virtual Hard Disk Wizard > Specify Name and Location dialog.

    Is there another way to reference VolumeID that will work with the New-VHD cmdlet?

    Other VHD creation cmdlets that will take a filesystem object?

    Sunday, July 26, 2020 3:04 AM

All replies