mirror of https://github.com/ansible/ansible.git
windows: fix list type in legacy module utils (#30483)
* windows: fix list type in legacy module utils
* only change the return for the list type instead of affecting it all
* additional null check when using an array
(cherry picked from commit 01563ccd5d
)
pull/30580/head
parent
1af9ab1b14
commit
8a247989c5
@ -0,0 +1,12 @@
|
|||||||
|
#powershell
|
||||||
|
|
||||||
|
#Requires -Module Ansible.ModuleUtils.Legacy
|
||||||
|
|
||||||
|
$params = Parse-Args $args
|
||||||
|
$value = Get-AnsibleParam -Obj $params -Name value -Type list
|
||||||
|
|
||||||
|
if ($value -isnot [array]) {
|
||||||
|
Fail-Json -obj @{} -message "value was not a list but was $($value.GetType().FullName)"
|
||||||
|
}
|
||||||
|
|
||||||
|
Exit-Json @{ count = $value.Count }
|
Loading…
Reference in New Issue