Add log messages

This commit is contained in:
Manuel Thalmann 2023-07-29 03:01:53 +02:00
parent c40d4ed83f
commit 7731c0dd71

View file

@ -375,6 +375,7 @@ class Context {
$currentScheme = [regex]::Match((powercfg /GETACTIVESCHEME), "Power Scheme GUID: ([0-9a-f-]) ").Groups[1].Value; $currentScheme = [regex]::Match((powercfg /GETACTIVESCHEME), "Power Scheme GUID: ([0-9a-f-]) ").Groups[1].Value;
if ($currentScheme -ne $performanceScheme) { if ($currentScheme -ne $performanceScheme) {
Write-Information "Disabling Power Save mode";
$this.Set("Power Scheme", $currentScheme); $this.Set("Power Scheme", $currentScheme);
powercfg /S 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c; powercfg /S 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c;
} }
@ -388,6 +389,7 @@ class Context {
$originalScheme = $this.Get("Power Scheme"); $originalScheme = $this.Get("Power Scheme");
if ($originalScheme) { if ($originalScheme) {
Write-Information "Reset power plan to original state";
powercfg /S $originalScheme; powercfg /S $originalScheme;
} }
} }