Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConvertTo-Json issue - Accounts_Onboard_Utility v10 #9

Closed
FIMTooler opened this issue Dec 15, 2018 · 1 comment
Closed

ConvertTo-Json issue - Accounts_Onboard_Utility v10 #9

FIMTooler opened this issue Dec 15, 2018 · 1 comment

Comments

@FIMTooler
Copy link

After much time spent digging into why account updates weren't working, it seems the below line is somewhat incorrect. Although the output looks almost identical, if there is only one operation in the $s_AccountBody array, the $restBody will be missing beginning and end [ ].

$restBody = $s_AccountBody | ConvertTo-Json -depth 5

{
"op": "replace",
"path": "/name",
"value": "OlderName"
}

Adjusting to this seems to work correctly even if there's only one object in the array.

$restBody = ConvertTo-Json @($s_AccountBody) -depth 5

[
{
"op": "replace",
"path": "/name",
"value": "OlderName"
}
]

@AssafMiron
Copy link
Contributor

Hi @FIMTooler ,

Thanks for your comments and testing.
I updated the code to reflect this change

Thanks,
Assaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants