Skip to content

Commit 75d72f3

Browse files
committed
self-hosted-runners: ensure post-deployment-script runs as administrator
During local testing, I forgot to run PowerShell as administrator and the installation of `pwsh` silently failed. Let's prevent the script from starting if we're not an admin. Ref: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.4#-runasadministrator Signed-off-by: Dennis Ameling <[email protected]>
1 parent 9cff2f8 commit 75d72f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

azure-self-hosted-runners/post-deployment-script.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -RunAsAdministrator
2+
13
param (
24
# https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners
35
[Parameter(Mandatory = $true, HelpMessage = "GitHub Actions Runner registration token. Note that these tokens are only valid for one hour after creation, so we always expect the user to provide one.")]

0 commit comments

Comments
 (0)