From 050221da47dfc1eb4ad12e165bfd46b3c80b05f8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 16 Aug 2024 14:35:35 +0200 Subject: [PATCH] Disable Windows Update reboot only as admin --- scripts/Common/Scripts/Operations.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index 86cda068..fdc487e4 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -29,7 +29,10 @@ $null = New-Module { $env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE; } - Disable-WindowsUpdateAutoRestart; + if (Test-Admin) { + Disable-WindowsUpdateAutoRestart; + } + New-Alias -Force "sudo" gsudo; & $Action; }