Update Windows/PSPatching.ps1
This commit is contained in:
parent
f107ecb900
commit
0a3eceacae
|
@ -1,16 +1,16 @@
|
|||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
||||
Install-Module PSWindowsUpdate -Force
|
||||
Import-Module PSWindowsUpdate
|
||||
|
||||
|
||||
Get-WUList -verbose
|
||||
|
||||
|
||||
Install-WindowsUpdate -AcceptAll -ignorereboot | Out-File "C:\Windows\Temp\$(get-date -f yyyy-MM-dd)-WindowsUpdate.log" -force
|
||||
|
||||
Get-WURebootStatus -silent
|
||||
|
||||
|
||||
$tonight = (Get-Date -Hour 23)
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
||||
Install-Module PSWindowsUpdate -Force
|
||||
Import-Module PSWindowsUpdate
|
||||
|
||||
|
||||
Get-WUList -verbose
|
||||
|
||||
|
||||
Install-WindowsUpdate -AcceptAll -ignorereboot | Out-File "C:\Windows\Temp\$(get-date -f yyyy-MM-dd)-WindowsUpdate.log" -force
|
||||
|
||||
Get-WURebootStatus -silent
|
||||
|
||||
|
||||
$tonight = (Get-Date -Hour 23)
|
||||
Get-WURebootStatus -ScheduleReboot $tonight | select RebootScheduled
|
Loading…
Reference in a new issue