Just installed PowerShell 5 on my W7SP1 box. Wanted to use it to examine installed programs. Tried:
get-ciminstance -ClassName Win32_InstalledWin32Program
That worked but unsurprisingly gave a long list with a lot of information that I didn't need, so I tried to narrow it down.
Tried:
get-ciminstance -ClassName Win32_InstalledWin32Program | get-object name
and that gave an error because (being very new to PowerShell) I had tried get-object whereas it should have been select-object.
So I tried again, this time using select-object and got:
get-ciminstance : Cannot create a file when that file already exists.
At line:1 char:10
+ $progs = get-ciminstance -ClassName Win32_InstalledWin32Program
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (root\cimv2:Win32_InstalledWin32Program:String) [Get-CimInstance], CimEx
ception
+ FullyQualifiedErrorId : HRESULT 0x800700b7,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
Any time I try using get-ciminstance -classname I get this same error now.
Tried using procmon pointing at the PowerShell process to see what was happening but the only file access I could see was it reading DLLs.
Totally confused. Anyone know what the problem is or have any suggestions as to how to analyse?