|
|
|
@ -201,11 +201,12 @@ Function Get-AnsibleParam($obj, $name, $default = $null, $resultobj = @{}, $fail
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# If $value -eq $null, the parameter was unspecified by the user (deliberately or not)
|
|
|
|
|
# If $null -eq $value, the parameter was unspecified by the user (deliberately or not)
|
|
|
|
|
# Please leave $null-values intact, modules need to know if a parameter was specified
|
|
|
|
|
# When $value is already an array, we cannot rely on the null check, as an empty list
|
|
|
|
|
# is seen as null in the check below
|
|
|
|
|
if ($null -ne $value -or $value -is [array]) {
|
|
|
|
|
if ($null -eq $value) {
|
|
|
|
|
return $null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($type -eq "path") {
|
|
|
|
|
# Expand environment variables on path-type
|
|
|
|
|
$value = Expand-Environment($value)
|
|
|
|
@ -249,7 +250,6 @@ Function Get-AnsibleParam($obj, $name, $default = $null, $resultobj = @{}, $fail
|
|
|
|
|
# , is not a typo, forces it to return as a list when it is empty or only has 1 entry
|
|
|
|
|
return ,$value
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $value
|
|
|
|
|
}
|
|
|
|
|