Hello All,
I have been stuck with this error for too long now, I am trying to manage/manage nodes on SolarWinds. I can achieve that using the below curl command on my windows command prompt, but at the same time I try to put this piece of code in a PowerShell script and execute I stumble upon this error, I know this is related to the way parameters are being taken in a PowerShell compared to the command prompt. any help would be appreciated.
curl command: curl -v -k -u admin:xxxxx ^
-H "Content-Type: application/json" ^
-d "["""N:1""","""2024-12-09T12:00:00""","""2024-12-09T14:00:00""",false,true]" ^
orionserver:17778/.../Unmanage
Powershell script: Below script gives me error saying
There was an error deserializing the object of tthe ype system.object the value 'N:1' cannot be parsed as type 'double'
# Node details $nodeId = "1" $startTime = "2024-12-09T12:00:00" $endTime = "2024-12-09T14:00:00" # Construct the curl command dynamically $curlCommand = @" curl.exe -v -k -u admin:xxxxx ^ -H "Content-Type: application/json" ^ -d "["""N:$nodeId""","""$startTime""","""$endTime""",false,true]" ^ https://orionserver:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Nodes/Unmanage "@ # Execute the command Invoke-Expression $curlCommand