diff options
author | Dreamcat4 <dreamcat4@gmail.com> | 2016-04-20 14:13:03 +0100 |
---|---|---|
committer | Dreamcat4 <dreamcat4@gmail.com> | 2016-04-20 14:13:03 +0100 |
commit | 8734e8f397275c54134e67a2f7ee504e22aebc21 (patch) | |
tree | 738c384ce6bdfc982729757c8988e26c83ed9834 /windows/win_environment.ps1 | |
parent | 55c6aee5d17b05f210089c4fdf15632300891bd6 (diff) | |
download | ansible-modules-extras-8734e8f397275c54134e67a2f7ee504e22aebc21.tar.gz |
fix: win-environment strict-mode fixes
Diffstat (limited to 'windows/win_environment.ps1')
-rw-r--r-- | windows/win_environment.ps1 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/windows/win_environment.ps1 b/windows/win_environment.ps1 index 1398524c..bece0812 100644 --- a/windows/win_environment.ps1 +++ b/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'" } |