mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-24 05:37:45 +08:00
Windows 11 23H2 version which will replace Windows 11 22H2 once the
new version is deemed as stable. Until then, 23h2 tests will be set
as insignificant.
Task-number: QTQAINFRA-6075
Task-number: QTQAINFRA-6244
Change-Id: I15054813896210fadf14da815ad5a7b3e402e800
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
(cherry picked from commit 5157d1ef93)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
25 lines
779 B
PowerShell
25 lines
779 B
PowerShell
# Copyright (C) 2017 The Qt Company Ltd.
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
|
|
|
# This script disables the automatic Windows updates
|
|
|
|
$service = get-service wuauserv
|
|
if (-not $service) {
|
|
Write-Host "Windows Update service not found."
|
|
exit 0
|
|
}
|
|
|
|
if ($service.Status -eq "Stopped") {
|
|
Write-Host "Windows Update service already stopped."
|
|
} else {
|
|
Write-Host "Stopping Windows Update service."
|
|
Stop-Service -Name "wuauserv" -Force
|
|
}
|
|
|
|
$startup = Get-WmiObject Win32_Service | Where-Object {$_.Name -eq "wuauserv"} | Select -ExpandProperty "StartMode"
|
|
if ($startup -ne "Disabled") {
|
|
set-service wuauserv -startup disabled
|
|
} else {
|
|
Write-Host "Windows Update service startup already disabled."
|
|
}
|