mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix logic to ensure state is either present or absent
This commit is contained in:
parent
630c0cf57e
commit
ba4b2d04d9
1 changed files with 2 additions and 2 deletions
|
@ -37,8 +37,8 @@ Else {
|
|||
|
||||
If ($params.state) {
|
||||
$state = $params.state.ToString().ToLower()
|
||||
If (!($state -eq 'present') -or ($state -eq 'absent')) {
|
||||
Fail-Json $result "state must be 'present' or 'absent'"
|
||||
If (($state -ne 'present') -and ($state -ne 'absent')) {
|
||||
Fail-Json $result "state is '$state'; must be 'present' or 'absent'"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue