win_uri: fix body with one item in list (#49484)

This commit is contained in:
Andrea Scarpino
2018-12-12 05:06:54 +01:00
committed by Jordan Borean
parent a24cc8b235
commit 06099bd116
3 changed files with 26 additions and 1 deletions

View File

@@ -179,7 +179,7 @@ if ($user -and $password) {
}
if ($null -ne $body) {
if ($body -is [Hashtable]) {
if ($body -is [System.Collections.IDictionary] -or $body -is [System.Collections.IList]) {
$body_string = ConvertTo-Json -InputObject $body -Compress
} elseif ($body -isnot [String]) {
$body_string = $body.ToString()