Get-CimInstance PowerShell cmdlet doesn't have any methods

If you've moved from the Get-WmiObject to the new Get-CimInstance cmdlets you may find that these no longer have the methods available that you would have had when using Get-WmiObject.

This is because everything is being routed correctly though the WS-MAN protocol and the objects that are returned are not code and cannot be executed.

It's a simple work around - just pipe the object back to the Invoke-CimMethod cmdlet...

$printers = Get-CimInstance Win32_Printer
$descriptor = $printers[0] | Invoke-CimMethod -MethodName GetSecurityDescriptor

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations