I followed the Scripting Guy instructions from Microsoft but even with this I still get the same error Scripting Guy article
here is my script:
$p2=Get-CimInstance -N root\cimv2\power -Class win32_PowerPlan -Filter "ElementName = 'Balanced'"
Invoke-CimMethod -InputObject $p2-MethodName Activate
which results in:
Invoke-CimMethod : This method is not implemented in any class
At line:1 char:1
+ Invoke-CimMethod -InputObject $p2 -MethodName Activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (Win32_PowerPlan...2-f694-41f0...):CimInstance) [Invoke-CimMethod], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041055,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand
I cant seem to find answers I have looked in a few locations, I have seen people start to run into this a few months ago but I could not find an answer any advice would be appreciated
my end goal is to write a script where I import a powerplan and then activate it I have the import part working fine it just this last bit. $p contains my imported plan I used $p2 on a default plan for testing purposes.
cheers and thank you in advance for any advice you can offer