Skip to content

Instantly share code, notes, and snippets.

@JLogan3o13
Last active September 6, 2022 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JLogan3o13/4ad71c05374fe029872558ccba2fa845 to your computer and use it in GitHub Desktop.
Save JLogan3o13/4ad71c05374fe029872558ccba2fa845 to your computer and use it in GitHub Desktop.
Search for bot in CR
$sessionHeader = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$sessionHeader.Add('x-Authorization', $Response.token)
$sessionHeader.Add('accept', 'application/json')
$type = "application/json"
$body = @{
'filter' = @{
'operator' = "substring"
'field' = "name"
'value' = "<name of bot to search for>"
}
}
$bodyJson = $body | ConvertTo-Json
$Response = Invoke-RestMethod -Method Post -Uri $URL -Body $bodyJson -Headers $sessionHeader -ContentType $type
$Response.list | Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment