From 1fee46270ce5f9cb2f4f15e77a737f3b31f3cf8b Mon Sep 17 00:00:00 2001 From: Paul Durivage Date: Thu, 19 Jun 2014 16:41:05 -0500 Subject: [PATCH] Move check down for access to --- windows/win_user.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/windows/win_user.ps1 b/windows/win_user.ps1 index 5fbb5cca27d..25267b631bf 100644 --- a/windows/win_user.ps1 +++ b/windows/win_user.ps1 @@ -56,11 +56,6 @@ If (-not $params.name.GetType) Fail-Json $result "missing required arguments: name" } -If (-not $params.password.GetType) -{ - Fail-Json $result "missing required arguments: password" -} - If ($params.state) { $state = $params.state.ToString().ToLower() If (($state -ne 'present') -and ($state -ne 'absent')) { @@ -71,6 +66,11 @@ Elseif (!$params.state) { $state = "present" } +If ((-not $params.password.GetType) -and ($state -eq 'present')) +{ + Fail-Json $result "missing required arguments: password" +} + $username = Get-Attr $params "name" $password = Get-Attr $params "password"