Skip to content

Instantly share code, notes, and snippets.

@gsscoder
Created June 2, 2020 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsscoder/8ef5c17f5f95e296d690f7514a1375d0 to your computer and use it in GitHub Desktop.
Save gsscoder/8ef5c17f5f95e296d690f7514a1375d0 to your computer and use it in GitHub Desktop.
PowerShell script to list Terraform Cloud runs
$token = '*************YOUR****TOKEN******HERE******************************************************'
$workspaceId = 'ws-bbaGwqP1yANww4va'
$response = Invoke-WebRequest -Uri "https://app.terraform.io/api/v2/workspaces/$workspaceId/runs" `
-Method Get `
-ContentType 'application/vnd.api+json' `
-Headers @{
Authorization = "Bearer $token"
} `
-UseBasicParsing
$response | Write-Host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment