diff --git a/ConnectWiseControlAPI/Public/PageService/Remove-CWCSession.ps1 b/ConnectWiseControlAPI/Public/PageService/Remove-CWCSession.ps1 index ea8f4ce..89ec864 100644 --- a/ConnectWiseControlAPI/Public/PageService/Remove-CWCSession.ps1 +++ b/ConnectWiseControlAPI/Public/PageService/Remove-CWCSession.ps1 @@ -11,16 +11,21 @@ function Remove-CWCSession $Endpoint = 'Services/PageService.ashx/AddSessionEvents' $SessionEventType = 21 - $Body = ConvertTo-Json @( + + $GuidList = @() + foreach ($SessionID in $GUID) + { + $GuidList += @{ + SessionID = $SessionID + EventType = $SessionEventType + } + } + + $Body = ConvertTo-Json -Compress -InputObject @( @( $Group ), - @( - @{ - SessionID = $GUID - EventType = $SessionEventType - } - ) + $GuidList ) $WebRequestArguments = @{