From 6562e8d36b14908bdc2220e56332d79d07e9cd32 Mon Sep 17 00:00:00 2001 From: iRaven4522 Date: Sat, 18 Oct 2025 16:32:05 -0500 Subject: [PATCH] hardcoded WUServer --- MDT-WinUpdate.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MDT-WinUpdate.ps1 b/MDT-WinUpdate.ps1 index a00d525..9edd346 100644 --- a/MDT-WinUpdate.ps1 +++ b/MDT-WinUpdate.ps1 @@ -23,7 +23,7 @@ $PSModulePathAU = $env:PSModulePath.split(';')[1] # All Users PSModule path if ($MDT){ $MDTPath = $Global:TSEnv.Value("DeployRoot") } -$WUServer = (Get-ItemProperty HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate).WUServer +$WUServer = "http://fluttershy.technolog.net:8530" ## Functions @@ -58,17 +58,17 @@ Function RunWinUpdate { # Run Windows Updates try { Write-LogEntry -Value "Installing all available Windows Updates..." -Severity 1 -Component "RunWinUpdate" -FileName $ScriptLog Write-Host -ForegroundColor Yellow "Installing all available Windows Updates..." - if ($WUServer -and !($Reboot)){ - Install-WindowsUpdate -AcceptAll -IgnoreReboot - #Requires -RunAsAdministrator - } elseif ($WUServer -and $Reboot) { - Install-WindowsUpdate -AcceptAll -AutoReboot + if (($null -eq $WUServer) -and !($Reboot)){ + Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot #Requires -RunAsAdministrator } elseif (($null -eq $WUServer) -and $Reboot){ Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot #Requires -RunAsAdministrator + } elseif ($WUServer -and $Reboot) { + Install-WindowsUpdate -AcceptAll -AutoReboot + #Requires -RunAsAdministrator } else { - Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot + Install-WindowsUpdate -AcceptAll -IgnoreReboot #Requires -RunAsAdministrator } return $true