【发布时间】:2019-11-06 18:00:31
【问题描述】:
我希望使用 Powershell 获取 VHD 挂载的驱动器号。我可以使用以下 cmdlet 挂载 VHD:
Mount-VHD -Path d:/tmp.vhdx
挂载工作正常,但是当我尝试获取驱动器号时:
Get-DiskImage -ImagePath d:\tmp.vhdx | Get-Disk | Get-Partition | Get-Volume ).DriveLetter
失败并出现以下错误:
Get-DiskImage : 无效属性
我相信Get-DiskImage 适用于 ISO,但不适用于 VHD?你能帮我弄到 VHD 吗?
【问题讨论】:
-
$Volumes = Mount-VHD -Path d:\temp.vhdx -PassThru | Get-Disk | Get-Partition | Get-VolumeSee the help
标签: powershell