From 8734e8f397275c54134e67a2f7ee504e22aebc21 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 --- windows/win_environment.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows/win_environment.ps1 b/windows/win_environment.ps1 index 1398524cfbb..bece081282d 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'" }