...
|
...
|
@@ -1,6 +1,6 @@
|
1
|
1
|
#!powershell
|
2
|
2
|
|
3
|
|
-# Copyright (c) 2017 Ansible Project
|
|
3
|
+# Copyright: (c) 2017, Ansible Project
|
4
|
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
5
|
5
|
|
6
|
6
|
#Requires -Module Ansible.ModuleUtils.Legacy
|
...
|
...
|
@@ -172,12 +172,12 @@ Function Set-ActivePowerPlan {
|
172
|
172
|
|
173
|
173
|
$res = 0
|
174
|
174
|
if ($PSCmdlet.ShouldProcess($Plan, "Set Power Plan")) {
|
175
|
|
- $res = [Ansible.WinPowerPlan.NativeMethods]::PowerSetActiveScheme([IntPtr]::Zero, $plan_guid)
|
|
175
|
+ $res = [Ansible.WinPowerPlan.NativeMethods]::PowerSetActiveScheme([IntPtr]::Zero, $Plan)
|
176
|
176
|
}
|
177
|
177
|
|
178
|
178
|
if ($res -ne 0) {
|
179
|
179
|
$err_msg = Get-LastWin32ErrorMessage -ErrorCode $res
|
180
|
|
- Fail-Json -obj $result -message "Failed to set the active power plan to $name - $err_msg"
|
|
180
|
+ Fail-Json -obj $result -message "Failed to set the active power plan to $Plan - $err_msg"
|
181
|
181
|
}
|
182
|
182
|
}
|
183
|
183
|
|