Created
May 10, 2018 00:45
-
-
Save frankfuu/d8f24884ec191fa6f703e4f6db1dcb7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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