-1

我正在跑步Get-CimInstance -Namespace root/CIMV2 -ClassName CIM_Component | Out-File -Encoding utf8 .\CIM_Component.txt并收到

Get-CimInstance : Call cancelled
At line:1 char:2
+ (Get-CimInstance -Namespace root/CIMV2 -ClassName CIM_DirectoryContai ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041032,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

不是从键盘中断中取消的。它只是...超时?我真的不知道为什么它完全取消了。

我希望其他人可能知道它引发了呼叫取消错误发生了什么。

可能只是因为信息量太多而导致它丢了管道......但是,它不是内存不足错误......

我不知道!

4

1 回答 1

0

***强文本***嗯......请参阅下面的潜在启发......

CIM_Component 类

我看到一个关于 CIM_Component 类的问题,想知道它是什么。所以我试了一下

Get-CimInstance -Namespace root\CIMV2 -ClassName CIM_Component | select -f 1 | fl *

# Results

GroupComponent : Win32_Directory (Name = "<directory path>")
PartComponent : CIM_DataFile (Name = "<file path>”)
PSComputerName :
CimClass : root/CIMV2:CIM_DirectoryContainsFile
CimInstanceProperties : {GroupComponent, PartComponent}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties

您将获得系统上每个文件的列表——显示 GroupComponent(父)中的文件夹和 PartComponent(子)中的文件。

该文档是完全准确且完全无用的,因为它解释了您获得了亲子关系,但不是其中的内容!

我强烈建议不要使用这个类——有更简单的方法来获取信息。

于 2019-04-26T00:18:34.650 回答