【发布时间】:2015-04-20 22:12:42
【问题描述】:
我正在使用此代码获取 Path、VolumeLabel、TotalSize、FreeSpace:
gwmi -ComputerName $ComputerName -namespace root\MSCluster MSCluster_DiskPartition -Credential $cred -Authentication PacketPrivacy | Format-Table Path, VolumeLabel, TotalSize, FreeSpace -AutoSize
输出:
Path VolumeLabel TotalSize FreeSpace
---- ----------- --------- ---------
U: Archive1 4194184 379651
\\?\Volume{76795fb2-254e-454d-a95a-739018690cf4} Archive3 4194184 524883
X: Archive2 4194184 735366
\\?\Volume{57e93910-60f9-44b9-8d9d-29d506e1e3d7} Archive4 4194184 1483274
如何从卷 GUID 中获取安装点的真实路径(或驱动器名称)?
我尝试使用 .GetRelated 类但没有成功。有人可以帮我解决这个问题吗?
【问题讨论】:
-
@KostiaShiian 我不能使用 Win32_Volume 或 Win32_DiskDrive 因为我正在使用 MSCluster_DiskPartition 类从集群角度获取对象。
-
这是要求 C# 解决方案吗? powershell 将如何发挥作用?
-
根据the documentation,该类具有
MountPoints属性,但在Windows Server 2012 之前不受支持。@ALIENQuake:您是否尝试过获取Win32_Volume并确认它不返回MSCluster_DiskPartition卷的信息?
标签: c# windows powershell failovercluster