@@ -11,7 +11,7 @@ Vagrant.configure("2") do |config|
1111 end
1212 config . winrm . max_tries = 300 # default is 20
1313 config . winrm . retry_delay = 5 #seconds. This is the defaul value and just here for documentation.
14- config . vm . provision "shell" , powershell_elevated_interactive : false , privileged : false , inline : <<-SHELL
14+ config . vm . provision "shell" , powershell_elevated_interactive : true , privileged : true , inline : <<-SHELL
1515 # Install Chocolatey - Also Grabs 7Zip
1616 Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -AddToPath"
1717 Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
@@ -34,17 +34,14 @@ Vagrant.configure("2") do |config|
3434 New-ItemProperty -Path "HKLM:\\ SYSTEM\\ CurrentControlSet\\ Control\\ FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
3535 # github actions
3636 Invoke-WebRequest -Uri ${GITHUB_RUNNER_URL} -OutFile ${GITHUB_RUNNER_FILE}
37- Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner -Force;
38- C:\\ runner\\ config.cmd --name ${GITHUB_RUNNER_NAME} --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}
39- C:\\ runner\\ run.cmd
40- # Remove-Item -Path C:\\ runner-* -Recurse -Force
41- # for ($runner = 1 ; $runner -le ${RUNNERS} ; $runner++){
42- # Write-Host "Running $runner";
43- # $random = -join ((48..57) + (97..122) | Get-Random -Count 8 | % {[char]$_});
44- # Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner-$random -Force;
45- # Invoke-Expression -Command "C:\\ runner-$random\\ config.cmd --name ${GITHUB_RUNNER_NAME}_$random --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}";
46- # Start-Process -NoNewWindow "C:\\ runner-$random\\ run.cmd";
47- # }
37+ Remove-Item -Path C:\\ runner-* -Recurse -Force
38+ for ($runner = 1 ; $runner -le ${RUNNERS} ; $runner++){
39+ Write-Host "Running $runner";
40+ $random = -join ((48..57) + (97..122) | Get-Random -Count 8 | % {[char]$_});
41+ Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner-$random -Force;
42+ Invoke-Expression -Command "C:\\ runner-$random\\ config.cmd --name ${GITHUB_RUNNER_NAME}_$random --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}";
43+ Start-Process "C:\\ runner-$random\\ run.cmd";
44+ }
4845 SHELL
4946end
5047
0 commit comments