hardcoded WUServer
This commit is contained in:
@@ -23,7 +23,7 @@ $PSModulePathAU = $env:PSModulePath.split(';')[1] # All Users PSModule path
|
|||||||
if ($MDT){
|
if ($MDT){
|
||||||
$MDTPath = $Global:TSEnv.Value("DeployRoot")
|
$MDTPath = $Global:TSEnv.Value("DeployRoot")
|
||||||
}
|
}
|
||||||
$WUServer = (Get-ItemProperty HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate).WUServer
|
$WUServer = "http://fluttershy.technolog.net:8530"
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@@ -58,17 +58,17 @@ Function RunWinUpdate { # Run Windows Updates
|
|||||||
try {
|
try {
|
||||||
Write-LogEntry -Value "Installing all available Windows Updates..." -Severity 1 -Component "RunWinUpdate" -FileName $ScriptLog
|
Write-LogEntry -Value "Installing all available Windows Updates..." -Severity 1 -Component "RunWinUpdate" -FileName $ScriptLog
|
||||||
Write-Host -ForegroundColor Yellow "Installing all available Windows Updates..."
|
Write-Host -ForegroundColor Yellow "Installing all available Windows Updates..."
|
||||||
if ($WUServer -and !($Reboot)){
|
if (($null -eq $WUServer) -and !($Reboot)){
|
||||||
Install-WindowsUpdate -AcceptAll -IgnoreReboot
|
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot
|
||||||
#Requires -RunAsAdministrator
|
|
||||||
} elseif ($WUServer -and $Reboot) {
|
|
||||||
Install-WindowsUpdate -AcceptAll -AutoReboot
|
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
} elseif (($null -eq $WUServer) -and $Reboot){
|
} elseif (($null -eq $WUServer) -and $Reboot){
|
||||||
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
|
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
|
} elseif ($WUServer -and $Reboot) {
|
||||||
|
Install-WindowsUpdate -AcceptAll -AutoReboot
|
||||||
|
#Requires -RunAsAdministrator
|
||||||
} else {
|
} else {
|
||||||
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot
|
Install-WindowsUpdate -AcceptAll -IgnoreReboot
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
}
|
}
|
||||||
return $true
|
return $true
|
||||||
|
Reference in New Issue
Block a user