mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-02 23:37:18 +08:00
[windows] disable WindowsUpdate service (#8605)
This commit is contained in:
@@ -89,6 +89,9 @@ $regUserServicesToDisables | ForEach-Object {
|
||||
} | Out-Null
|
||||
|
||||
|
||||
Write-Host 'Disable Windows Update Service'
|
||||
Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\wuauserv -Name Start -Value 4 -Force
|
||||
|
||||
# Disabled services
|
||||
$servicesToDisable = @(
|
||||
'wuauserv'
|
||||
@@ -102,6 +105,7 @@ $servicesToDisable = @(
|
||||
)
|
||||
|
||||
$servicesToDisable | ForEach-Object {
|
||||
Stop-Service -Name $_
|
||||
Set-Service -Name $_ -StartupType Disabled -ErrorAction Ignore
|
||||
} | Out-Null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user