Move check down for access to
This commit is contained in:
parent
44fcebc5aa
commit
1fee46270c
1 changed files with 5 additions and 5 deletions
|
@ -56,11 +56,6 @@ If (-not $params.name.GetType)
|
||||||
Fail-Json $result "missing required arguments: name"
|
Fail-Json $result "missing required arguments: name"
|
||||||
}
|
}
|
||||||
|
|
||||||
If (-not $params.password.GetType)
|
|
||||||
{
|
|
||||||
Fail-Json $result "missing required arguments: password"
|
|
||||||
}
|
|
||||||
|
|
||||||
If ($params.state) {
|
If ($params.state) {
|
||||||
$state = $params.state.ToString().ToLower()
|
$state = $params.state.ToString().ToLower()
|
||||||
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
||||||
|
@ -71,6 +66,11 @@ Elseif (!$params.state) {
|
||||||
$state = "present"
|
$state = "present"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
If ((-not $params.password.GetType) -and ($state -eq 'present'))
|
||||||
|
{
|
||||||
|
Fail-Json $result "missing required arguments: password"
|
||||||
|
}
|
||||||
|
|
||||||
$username = Get-Attr $params "name"
|
$username = Get-Attr $params "name"
|
||||||
$password = Get-Attr $params "password"
|
$password = Get-Attr $params "password"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue