From 820d5a7a3e50e2ace5df5a6ee4a778eb9708effb Mon Sep 17 00:00:00 2001 From: Dreamcat4 Date: Wed, 20 Apr 2016 14:13:03 +0100 Subject: [PATCH] fix: win-environment strict-mode fixes --- lib/ansible/modules/extras/windows/win_environment.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_environment.ps1 b/lib/ansible/modules/extras/windows/win_environment.ps1 index 1398524cfb..bece081282 100644 --- a/lib/ansible/modules/extras/windows/win_environment.ps1 +++ b/lib/ansible/modules/extras/windows/win_environment.ps1 @@ -20,11 +20,12 @@ # POWERSHELL_COMMON $params = Parse-Args $args; +$state = Get-Attr $params "state" $null; $result = New-Object PSObject; Set-Attr $result "changed" $false; -If ($params.state) { - $state = $params.state.ToString().ToLower() +If ($state) { + $state = $state.ToString().ToLower() If (($state -ne 'present') -and ($state -ne 'absent') ) { Fail-Json $result "state is '$state'; must be 'present', or 'absent'" }