Skip to content

Instantly share code, notes, and snippets.

Last active September 6, 2022 16:19
What would you like to do?
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