-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Description
Current behavior
ipRanges are not serialized to JSON when making a request.
# Request made.
$Body = @{
"@odata.type" = "#microsoft.graph.ipNamedLocation"
displayName = "Untrusted IP named location"
isTrusted = $false
ipRanges = @(
@{ cidrAddress = "12.34.221.11/22" }
@{ cidrAddress = "2001:0:9d38:90d6:0:0:0:0/63" })
}
New-MgIdentityConditionalAccessNamedLocation -BodyParameter $Body -Debug# Debug log - ipRanges is not serialized to JSON.
DEBUG: POST /v1.0/identity/conditionalAccess/namedLocations HTTP/1.1
HTTP: graph.microsoft.com
Content-Type: application/json
{
"ipRanges": [
[ "System.Collections.DictionaryEntry" ],
[ "System.Collections.DictionaryEntry" ]
],
"isTrusted": false,
"@odata.type": "#microsoft.graph.ipNamedLocation",
"displayName": "Untrusted IP named location"
}Expected behavior
Objects set to -BodyParameter or -AdditionalProperties should be fully serialized to JSON Irregardless of the depth.
$Body = @{
"@odata.type" = "#microsoft.graph.ipNamedLocation"
displayName = "Untrusted IP named location"
isTrusted = $false
ipRanges = @(
@{ cidrAddress = "12.34.221.11/22" }
@{ cidrAddress = "2001:0:9d38:90d6:0:0:0:0/63" })
}
New-MgIdentityConditionalAccessNamedLocation -BodyParameter $Body -Debug# Debug log
DEBUG: POST /v1.0/identity/conditionalAccess/namedLocations HTTP/1.1
HTTP: graph.microsoft.com
Content-Type: application/json
{
"ipRanges": [
{ "cidrAddress": "12.34.221.11/22" },
{ "cidrAddress": "2001:0:9d38:90d6:0:0:0:0/63" }
],
"isTrusted": false,
"@odata.type": "#microsoft.graph.ipNamedLocation",
"displayName": "Untrusted IP named location"
}