Created
October 19, 2018 16:31
-
-
Save scottd3v/379a986cf47bdedfeca7fae1f73641d5 to your computer and use it in GitHub Desktop.
Events API PowerShell Example
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 characters
| $JCAPIKey = '' # Enter API Key here | |
| $StartDate = (Get-Date(Get-Date).AddDays(-1) -Format s) | |
| $EndDate = (Get-Date -Format s) | |
| $hdrs = @{"X-API-KEY" = "$JCAPIKey"} | |
| $EventsAPI = "https://events.jumpcloud.com/events?startDate=$StartDate`Z&endDate=$EndDate`Z" | |
| $events = Invoke-RestMethod -Method GET -Uri $EventsAPI -Header $hdrs | |
| # To output to a file run the below command | |
| $events | ConvertTo-Json | Out-File EventsData.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment