From 6ce98295c1c29fab0453d357d6d332277a5fc7cd Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Fri, 1 Feb 2019 07:07:46 +1000 Subject: [PATCH] fix for proper variable name --- lib/ansible/modules/windows/win_power_plan.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/windows/win_power_plan.ps1 b/lib/ansible/modules/windows/win_power_plan.ps1 index 645eefece95..af66146d27f 100644 --- a/lib/ansible/modules/windows/win_power_plan.ps1 +++ b/lib/ansible/modules/windows/win_power_plan.ps1 @@ -172,12 +172,12 @@ Function Set-ActivePowerPlan { $res = 0 if ($PSCmdlet.ShouldProcess($Plan, "Set Power Plan")) { - $res = [Ansible.WinPowerPlan.NativeMethods]::PowerSetActiveScheme([IntPtr]::Zero, $plan_guid) + $res = [Ansible.WinPowerPlan.NativeMethods]::PowerSetActiveScheme([IntPtr]::Zero, $Plan) } if ($res -ne 0) { $err_msg = Get-LastWin32ErrorMessage -ErrorCode $res - Fail-Json -obj $result -message "Failed to set the active power plan to $name - $err_msg" + Fail-Json -obj $result -message "Failed to set the active power plan to $Plan - $err_msg" } }