Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Can't get the Invoke-WmiMethod to work

$
0
0

The HP Display LiteSaver utility came with my monitor and stated:
HP Display LiteSaver installs a WMI Provider which creates a WMI object called Win32_DisplayPowerSaving in the root\CIMV2 namespace.
The WMI object has (among others) the following method: PowerOffNow (no parameters are given).

I'm completely new to WMI but wrote these two lines in PowerShell anyway:

PS C:\Users\allardb> $obj = Get-WmiObject -ComputerName AB -Namespace root/cimv2 -class win32_DisplayPowerSaving
PS C:\Users\allardb> $obj | Invoke-WmiMethod -Name PowerOffNow

No errors, no warnings, no result. Nothing happens.

What am I doing wrong?


Viewing all articles
Browse latest Browse all 8411