Created
May 3, 2015 10:35
Revisions
-
Sam-Martin created this gist
May 3, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Replace `yourdomain` with your service now URL. User must have the `rest_service` role. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ 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