这就是我所拥有的:
PS C:\Users\user> $idi=New-Object -ComObject IMAPI2.MsftDiscMaster2.1
PS C:\Users\user> $idi|get-member
TypeName: System.String
Name MemberType Definition
---- ---------- ----------
Clone Method System.Object Clone(), System.Object ICloneable.Clone()
CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int IComparab..
Contains Method bool Contains(string value)
CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int co..
EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompari.....
....
....
这是documentation of the IMAPI things,System.String是.net框架的一部分。
对我而言,MS看起来像用CLSID搞砸了。
答案 0 :(得分:1)
从评论切换到答案,因为我无法正确格式化输出。
Get-Member -InputObject $ idi返回:
TypeName: System.__ComObject#{27354130-7f64-5b0f-8f00-5d77afbe261e}
Name MemberType Definition
---- ---------- ----------
Item ParameterizedProperty string Item (int) {get}
Count Property int Count () {get}
IsSupportedEnvironment Property bool IsSupportedEnvironment () {get}
显示正确,Count / IsSupportedEnvironment正确识别我的笔记本电脑中没有光驱。