我正在尝试对通过Invoke-restMethod返回的两个对象使用Compare-Object。
使用供应商swagger页面,所有元素都完全暴露。 IE没有数组:
{
"type": "SP",
"id": "12345tygvcxsaw23456y",
"name": "Stormtrooper",
"entityId": "sb01.stormtrooper.com/SAML2",
"active": true,
"contactInfo": {
"company": "Empire",
"firstName": "Darth",
"lastName": "Vader",
"email": "DVader@stormtrooper.com"
},
"loggingMode": "STANDARD",
"virtualEntityIds": [],
"licenseConnectionGroup": "",
"credentials": {
"certs": [
{
"primaryVerificationCert": true,
"secondaryVerificationCert": false,
"certView": {
"id": "bnjki98765rfvb",
"serialNumber": "12345678912345678123456789",
"subjectDN": "CN=stormtrooper.com, O=\"Empire, Inc.\", L=Tatooine, ST=Utah, C=US, OID.2.5.4.17=23456, STREET=3301 N Thanksgiving Way Ste. 100
当我使用Invoke-RestMethod获得相同的返回时,似乎两个深的元素放在一个数组中:
{
"type": "SP",
"id": "12345tygvcxsaw23456y",
"name": "Stormtrooper",
"entityId": "sb01.stormtrooper.com/SAML2",
"active": true,
"contactInfo": {
"company": "Empire",
"firstName": "Darth",
"lastName": "Vader",
"email": "DVader@stormtrooper.com"
},
"loggingMode": "STANDARD",
"virtualEntityIds": [],
"licenseConnectionGroup": "",
"credentials": {
"certs": [
"@{primaryVerificationCert=True; secondaryVerificationCert=False; certView=; x509File=; encryptionCert=False}"
],
"signingSettings": {
"signingKeyPairRef": "@{id=98765edfghu8765rfgh; location=xxx}",
有没有办法'强制'调用Invoke-restMethod来返回完全展开的响应?