I have the below code snippet that saves a array of ~90 devices to my string $report
$report = Get-ADComputer -Filter * -SearchBase 'OU=Boston, DC=someCompany, DC=com' | Select -ExpandProperty name
Now my issue is when I try to pass this array to my Invoke-RestMethod command
$headers=@{}
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer mykeyhere")
$response = Invoke-RestMethod -Uri "https://app.ninjarmm.com/v2/devices/search?q=$report[0]" -Method GET -Headers $headers
When I run the above code snippet, I would think that $response returns the result of my first array of $report, but what actually happens is that it returns back $response in the attached photo.
Help appreciated, thanks yall