Replace yourdomain
with your service now URL. User must have the rest_service
role.
Created
May 3, 2015 10:35
-
-
Save Sam-Martin/d76e05d0b3f37c429afb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!$script:ServiceNowCreds){ | |
$script:ServiceNowCreds = Get-Credential | |
} | |
$uri = 'https://yourdomain.service-now.com/api/now/table/incident?sysparm_limit=10' | |
$Body = @{ | |
'sysparm_query' = 'ORDERBYDESCopened_at' | |
} | |
$result = Invoke-RestMethod -Uri $uri -Credential $script:ServiceNowCreds -Body $Body -ContentType "application/json" | |
$result.result | select opened_at, number, short_description |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment