Skip to content

Commit 906ef3b

Browse files
author
Robin Stolpe
committed
Changed/reverted param StopService & GitHubRunnerRegistrationUrl
Reverted Parameter StopService to string from boolen. Changed -notlike to -like in the parameter validation of GitHubActionRunnerRegistrationUrl
1 parent 85191a9 commit 906ef3b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ param (
1414
[string]$GithubActionsRunnerName,
1515

1616
[Parameter(Mandatory = $false, HelpMessage = "Stop Service immediately (useful for spinning up runners preemptively)")]
17-
[ValidateSet('true', 'false')]
18-
[string]$StopService = 'true',
17+
[bool]$StopService = $true,
1918

2019
[Parameter(Mandatory = $true, HelpMessage = "Path to the Actions Runner. Keep this path short to prevent Long Path issues, e.g. D:\a")]
2120
[ValidateNotNullOrEmpty()]
@@ -222,7 +221,7 @@ if ($null -eq (Get-Service -Name "actions.runner.*")) {
222221
}
223222

224223
# Immediately stop the service as we want to leave the VM in a deallocated state for later use. The service will automatically be started when Windows starts.
225-
if ($StopService -eq 'true') {
224+
if ($StopService -eq $true) {
226225
#Collects all running services named actions.runner.*
227226
$GetActionRunnerServices = Get-Service -Name "actions.runner.*" | Where-Object { $_.Status -eq 'Running' } | Select-Object -ExpandProperty Name
228227

0 commit comments

Comments
 (0)