Closed pspete closed 3 years ago
Describe the issue Executing Set-PASAccount while specifying a value for the -operations parameter for updating multiple properties results in an error. Updates to single properties are OK.
Set-PASAccount
-operations
To Reproduce Steps to reproduce the behavior:
[500] Object reference not set to an instance of an object.
Expected behavior LogonDomain set to SomeValue
Screenshots & Console Output
Console Output Code Block:
Set-PASAccount -id $id -operations $ops DEBUG: [Body] [ { "operations": [ { "path": "/platformAccountProperties/LogonDomain", "op": "replace", "value": "WinDomain" } ] } ] Invoke-PASRestMethod : [500] Object reference not set to an instance of an object. At line:240 char:14 + ... $Result = Invoke-PASRestMethod -Uri $URI -Method $Method -Body $Bod ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ({"ErrorCode":"C...of an object."}:ErrorRecord) [Invoke-PASRestMethod], Exception + FullyQualifiedErrorId : CAWS00001E,Invoke-PASRestMethod
Your Environment Include relevant details about your environment
Additional context JSON payload for this operation is being sent with an invalid structure. psPAS 4.5.87 includes changes to some ParamterSetNames, however the logic branch which correctly formats the JSON for this type of request was not updated to reference the new ParamterSetNames (on Line 151 V10MultiOp should be Gen2MultiOp) https://github.com/pspete/psPAS/blob/6970ba460c7cd9e3b912d66a9ab7ad3e7c3994e6/psPAS/Functions/Accounts/Set-PASAccount.ps1#L151
V10MultiOp
Gen2MultiOp
š¤¦ Fix incoming
Describe the issue Executing
Set-PASAccount
while specifying a value for the-operations
parameter for updating multiple properties results in an error. Updates to single properties are OK.To Reproduce Steps to reproduce the behavior:
[500] Object reference not set to an instance of an object.
Expected behavior LogonDomain set to SomeValue
Screenshots & Console Output
Console Output Code Block:
Your Environment Include relevant details about your environment
Additional context JSON payload for this operation is being sent with an invalid structure. psPAS 4.5.87 includes changes to some ParamterSetNames, however the logic branch which correctly formats the JSON for this type of request was not updated to reference the new ParamterSetNames (on Line 151
V10MultiOp
should beGen2MultiOp
) https://github.com/pspete/psPAS/blob/6970ba460c7cd9e3b912d66a9ab7ad3e7c3994e6/psPAS/Functions/Accounts/Set-PASAccount.ps1#L151š¤¦ Fix incoming