PowerShell Script: Execute Orchestrator API Call with an Access Token

by Simon Sparks · 9 February 2026

https://learn.microsoft.com/en-us/dotnet/framework/install/how-to-determine-which-versions-are-installed

[System.String]$strUsername="service-account-name";
[System.String]$strHostFQDN="orchestrator.cloudbuildtools.com";

[System.String]$strRequestUri="https://$strHostFQDN/vco/api/workflows?maxResult=10&startIndex=0&queryCount=false";

[System.Management.Automation.PSObject]$objPSObjectHeaders=@{"Accept"="application/json";"Authorization"=$strAccessToken};

[Microsoft.PowerShell.Commands.BasicHtmlWebResponseObject]$objBasicHtmlWebResponseObject=Invoke-WebRequest-Method Get-Uri$strRequestUri-Headers$objPSObjectHeaders-SkipCertificateCheck-SkipHeaderValidation;

Write-Host$objBasicHtmlWebResponseObject.content;

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like