wmi获取MSStorageDriver_ATAPISmartData子集的VendorSpecific的值


PowerShell交流中心分类: Questionswmi获取MSStorageDriver_ATAPISmartData子集的VendorSpecific的值
0
zbxmmp asked 7 年 ago


我就是想获取这个值
Get-WmiObject -Class MSStorageDriver_ATAPISmartData -Namespace “root/wmi”

1 Answers
2
Best Answer
Mooser Lee 管理员 answered 7 年 ago

VendorSpecific这个值是个字节数组:

PS> $s=(Get-WmiObject -Class MSStorageDriver_ATAPISmartData -Namespace 'root/wmi').VendorSpecific
PS> $s.GetType()

IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Byte[] System.Array


PS> $s -join ','
1,0,5,50,0,100,100,0,0,0,0,0,0,0,9,50,0,100,100,106,1,0,0,0,0,0,12,3,0,100,100,11,0,0,0,0,0,0,170,50,0,100,100,0,0,0,0,0
,0,0,171,3,0,100,100,0,0,0,0,0,0,0,172,3,0,100,100,0,0,0,0,0,0,0,173,3,0,100,100,46,0,0,0,0,0,0,174,3,0,100,100,3,0,0,0,
0,0,0,178,50,0,100,100,0,0,0,0,0,0,0,180,3,0,100,100,138,0,0,0,0,0,0,184,51,0,100,100,0,0,0,0,0,0,0,187,51,0,100,100,0,0
,0,0,0,0,0,194,2,0,100,100,45,0,0,0,0,0,0,199,50,0,100,100,0,0,0,0,0,0,0,233,3,0,100,100,255,255,255,0,0,0,0,241,3,0,100
,100,142,12,0,0,0,0,0,242,3,0,100,100,144,3,0,0,0,0,0,249,3,0,100,100,246,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,0,0,0,0,0,0,0

 

zbxmmp replied 7 年 ago

O(∩_∩)O谢谢