Home > Mobile >  Powershell Invoke-Response Where Clause
Powershell Invoke-Response Where Clause

Time:09-17

I have the following Powershell script that runs without issue. I am being told that I need to add "&onlyCurrent=false" to get it to pull information for employees with a future start date. I have no idea how to do this....

$response = Invoke-RestMethod 'https://api._________.com/api/gateway.php/gemco/v1/reports/120' -Method 'GET' -Headers $headers 

When I add this to the end, I get invalid parameter error message: -Where-Object onlyCurrent eq "false"

The support for they system I'm pulling this from has no information on how to do this. Absolutely any help would be very greatly appreciated.

CodePudding user response:

&onlyCurrent=false is probably a query string. You can append it at the end of the URL after ?. Note that & is used to separate multiple parameters, since you have just one it's not needed. Try changing the URL to:

https://api._________.com/api/gateway.php/gemco/v1/reports/120?onlyCurrent=false

CodePudding user response:

Figured it out. You have to add ?onlyCurrent=false after the 120 (inside the single quote).

  • Related