I am trying to copy a set of attribute values from one Category to another using PowerShell and REST … I have it working for all attribute value types except multi-value, I just can't seem to get the syntax correct.
"/v1/nodes/36500965/categories/3310115"
$body = @{
3310115_16 = "Track 1"
3310115_17 = ["Signals","Tracks","","","","","","","",""]
}
$response = Invoke-RestMethod $URL -Method PUT -body $body -Headers $header -ContentType "application/x-www-form-urlencoded"
Of course the $URL has the server etc, and as I say if I don't have multi-value attributes, I can update using the above syntax but I can't seem to get the multi-value to work. I've tried with and without double-quotes, with and without specifying allowed values (in this case, 10), with and without the square brackets….all end up with the same error
Invoke-RestMethod : {"error":"The value \u0027[\u0022Signals\u0022,\u0022Tracks\u0022,\u0022\u0022,\u0022\u0022,\u0022\u0022,\u0022\u0022,\u0022\u
0022,\u0022\u0022,\u0022\u0022,\u0022\u0022]\u0027 specified for \u0027Discipline\u0027 attribute is not
valid."
I am certain that both values "Signals" and "Tracks" are valid entries, this is just a syntax issue I believe but I'm just not getting there. I'd welcome any information that might get me there (or verification that "that just won't work in PowerShell").
Dave