Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Param(
[string]$pat,
[string]$url,
[string]$agentPrefix,
[string]$pool,
[string]$sourceDir,
[string]$tgtDirPrefix,
[int]$copies
)
## needs to run with Admin rights
foreach($n in 1..$copies)
{
$tgtDir = "$tgtDirPrefix-$n"
$agentName = "$agentPrefix-$n"
Copy-Item $sourceDir $tgtDir -Recurse
cd $tgtDir
Write-Host "Setting up $agentName"
.\config.cmd --unattended --url $url --auth pat --token $pat --runAsService --pool $pool --agent $agentName
cd ..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.