Skip to content

Commit

Permalink
Added script to update agent version
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Wöhrl committed Feb 28, 2020
1 parent edd6d6e commit 4cfb782
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Source/Public/Update-VSTeamAgent.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Update-VSTeamAgent {
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position = 0)]
[int] $PoolId,

[parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 1)]
[Alias('AgentID')]
[int[]] $Id
)

process {
foreach ($item in $Id) {
try {
_callAPI -Method Post -Area "distributedtask/pools/$PoolId" -Resource messages -QueryString @{agentId=$item} -Version $([VSTeamVersions]::DistributedTask) -ContentType "application/json" | Out-Null
Write-Output "Update agent $item"
}
catch {
_handleException $_
}
}
}
}

0 comments on commit 4cfb782

Please sign in to comment.