ConnectWiseControlAPI
ConnectWiseControlAPI copied to clipboard
Update Remove-CWCSession.ps1 to Correct JSON Format with multiple GUIDs
Correct Format of Json object when submitting multiple GUID's
The Call allows Multiple GUIDs to be sent in a single call [guid[]]$GUID
Currently when Multiple are passed the Created Json looks like
[
[
"All Machines"
],
[
{
"EventType": 21,
"SessionID": "719a6448-8713-447e-ad8d-47cbb504a2d5 3ad19bde-40da-4026-a5f7-82aa3bddad8b"
}
]
]
which puts multiple GUIDs under a single session ID
This change creates JSON like
[["All Machines"],[{"EventType":21,"SessionID":"719a6448-8713-447e-ad8d-47cbb504a2d5"},{"EventType":21,"SessionID":"3ad19bde-40da-4026-a5f7-82aa3bddad8b"}]]
which matches the calls from the web client
Expanded for readability
[
[
"All Machines"
],
[
{
"EventType":21,
"SessionID":"719a6448-8713-447e-ad8d-47cbb504a2d5"
},
{
"EventType":21,
"SessionID":"3ad19bde-40da-4026-a5f7-82aa3bddad8b"
}
]
]