mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Update azure-pipelines.yml for Azure Pipelines
This commit is contained in:
parent
c0f855dd10
commit
278f8947ad
1 changed files with 6 additions and 5 deletions
|
|
@ -56,9 +56,8 @@ stages:
|
||||||
$headers = @{
|
$headers = @{
|
||||||
Authorization = "Bearer $accessToken"
|
Authorization = "Bearer $accessToken"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host $uri
|
return Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
||||||
return Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host -ForeGroundColor Red 'Unhandled exception occurred during agent fetch!'
|
Write-Host -ForeGroundColor Red 'Unhandled exception occurred during agent fetch!'
|
||||||
|
|
@ -84,7 +83,6 @@ stages:
|
||||||
Authorization = "Bearer $accessToken"
|
Authorization = "Bearer $accessToken"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host $uri
|
|
||||||
return Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
return Invoke-RestMethod -Method Get -Uri $uri -Headers $headers -UseBasicParsing
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|
@ -113,11 +111,14 @@ stages:
|
||||||
Write-Host "BuildId = $BuildId; AgentId = $AgentId"
|
Write-Host "BuildId = $BuildId; AgentId = $AgentId"
|
||||||
|
|
||||||
$BuildData = Get-AzureDevopsBuild -baseUri "$(System.CollectionUri)$(System.TeamProject)/_apis" -accessToken $(System.AccessToken) -buildId $BuildId
|
$BuildData = Get-AzureDevopsBuild -baseUri "$(System.CollectionUri)$(System.TeamProject)/_apis" -accessToken $(System.AccessToken) -buildId $BuildId
|
||||||
|
Write-Host $BuildData
|
||||||
|
|
||||||
[int]$PoolId = $BuildData.queue.pool.id
|
[int]$PoolId = $BuildData.queue.pool.id
|
||||||
Write-Host "PoolId = $PoolId"
|
Write-Host "PoolId = $PoolId"
|
||||||
|
|
||||||
$AgentData = Get-AzureDevopsAgent -baseUri "$(System.CollectionUri)_apis" -accessToken $(System.AccessToken) -poolId $PoolId -agentId $AgentId
|
$AgentData = Get-AzureDevopsAgent -baseUri "$(System.CollectionUri)_apis" -accessToken $(System.AccessToken) -poolId $PoolId -agentId $AgentId
|
||||||
|
Write-Host $AgentData
|
||||||
|
|
||||||
Output-AgentCapabilities -capabilities $AgentData.systemCapabilities -capabilityType 'System'
|
Output-AgentCapabilities -capabilities $AgentData.systemCapabilities -capabilityType 'System'
|
||||||
Output-AgentCapabilities -capabilities $AgentData.userCapabilities -capabilityType 'User'
|
Output-AgentCapabilities -capabilities $AgentData.userCapabilities -capabilityType 'User'
|
||||||
pwsh: true
|
pwsh: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue