在我使用的一台计算机上,PowerShell cmdletGet-Disk
不显示Disk 0
. 但使用其他命令它会...
Get-Disk | Select Number, FriendlyName, HealthStatus, Size
Number FriendlyName HealthStatus Size
------ ------------ ------------ ----
1 Kingston DT2000 Healthy 15502147584
C:\> Get-Disk -Number 0
Get-Disk : No MSFT_Disk objects found with property 'Number' equal to '0'.
Verify the value of the property and retry.
At line:1 char:1
+ Get-Disk -Number 0
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (0:UInt32) [Get-Disk], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_Number,Get-Disk
Get-PhysicalDisk | Select DeviceId, FriendlyName, HealthStatus, Size
DeviceId FriendlyName HealthStatus Size
-------- ------------ ------------ ----
1 Kingston DT2000 Healthy 15502147584
0 KXG50ZNV1T02 NVMe TOSHIBA 1024GB Healthy 1024209543168
'list disk' | DiskPart
Microsoft DiskPart version 10.0.17763.1911
Copyright (C) Microsoft Corporation.
On computer: WIN-6S1H8T9U9AT
DISKPART>
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 953 GB 1024 KB * *
Disk 1 Online 14 GB 2048 KB
Get-Volume | Select DriveLetter, FileSystemLabel, HealthStatus, Size
DriveLetter FileSystemLabel HealthStatus Size
----------- --------------- ------------ ----
Healthy 100663296
C Healthy 1023562215424
Recovery Healthy 523235328
D KINGSTON Healthy 15498014720
Get-Partition
也在行动……
Get-Partition
DiskPath: \\?\usbstor#disk&ven_kingston&prod_dt2000&rev_...
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 D 4128768 14.43 GB IFS
有什么想法为什么Get-Disk
会Get-Partition
丢失Disk 0
吗?
编辑 1:添加 DiskPart 输出。
编辑 2:添加了强制Get-Disk
获取磁盘 0 时的错误消息。
这很可能是因为磁盘 0 是动态磁盘。
该
Get-Disk
cmdlet 仅显示基本磁盘,不显示动态磁盘。引用Get-Disk 的关于页面:您可以通过在 PowerShell 中运行以下语句来查找动态磁盘:
Get-CimInstance Win32_DiskPartition -Filter "Type='Logical Disk Manager'"
输出中存在 LDM(逻辑磁盘管理器)信息表明它是动态磁盘。