mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
[Windows] Unify services handling (#8871)
* [Windows] Unify services handling * Fix Set-Service usage
This commit is contained in:
committed by
GitHub
parent
6efbc46fc7
commit
79c347765a
@@ -105,10 +105,10 @@ $servicesToDisable = @(
|
||||
'gupdate'
|
||||
'gupdatem'
|
||||
'StorSvc'
|
||||
)
|
||||
|
||||
$servicesToDisable | Stop-SvcWithErrHandling
|
||||
$servicesToDisable | Set-SvcWithErrHandling -Arguments @{StartupType = "Disabled"}
|
||||
) | Get-Service -ErrorAction SilentlyContinue
|
||||
Stop-Service $servicesToDisable
|
||||
$servicesToDisable.WaitForStatus('Stopped', "00:01:00")
|
||||
$servicesToDisable | Set-Service -StartupType Disabled
|
||||
|
||||
# Disable scheduled tasks
|
||||
$allTasksInTaskPath = @(
|
||||
|
||||
Reference in New Issue
Block a user