I was running Get-CimInstance -Namespace root/CIMV2 -ClassName CIM_Component | Out-File -Encoding utf8 .\CIM_Component.txt
and received
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
This was not cancelled from a keyboard interrupt. It simply... timed out? I really don't know why it cancelled at all.
I was hoping someone else might know what happened that it threw the Call cancelled error.
It may simply be that the amount of information is just too much going threw the pipe that it... but, its not a out of memory error...
I have no idea!
***strong text***Hummm… See the below for potential edification...
I saw a question about the CIM_Component class and wondered what it was. So I tried it
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
What you’ll get is a list of every file on your system – showing folder in the GroupComponent (parent) and File in the PartComponent (child).
The documentation is totally accurate and totally useless as it explains that you get a parent-child relationship but not what’s in it!
I’d strongly recommend against using this class – there are easier ways to get the information.
User contributions licensed under CC BY-SA 3.0