Parsing Output of "powercfg -query"

I am having trouble parsing the output of the powercfg -Query


I assign it to a Variable and Need to extract only the block below 


Subgroup GUID: 238c9fa8-0aad-41ed-83f4-97be242c8f20  (Sleep)
 Power Setting GUID: 29f6c1db-86da-48c5-9fdb-f2b67b1f44da  (Sleep after)
   Minimum Possible Setting: 0x00000000
   Maximum Possible Setting: 0xffffffff
   Possible Settings increment: 0x00000001
   Possible Settings units: Seconds
 Current AC Power Setting Index: 0x00000000
 Current DC Power Setting Index: 0x00000000


I must assume that as a connect to multiple machines, the location of this block may be different.

Is there a way to do something like this with a Variable?

$out = powercfg -query
$out | ? {$_ -like "*(Sleep)" | Select NEXT 8 ....

Thank you!


Parents Reply Children
No Data