hardcoded WUServer
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user