From 81a567fbfc77e808897ec44880f020763a9b61d2 Mon Sep 17 00:00:00 2001 From: Default User Date: Wed, 1 Nov 2023 22:05:59 +1100 Subject: [PATCH] --- README.md | 4 ++-- docs/Patch-Windows---Security.html | 18 ++++++++++-------- docs/index.html | 12 ++++++------ steps/cleanupwindowsupdatetask/script.txt | 2 +- steps/listmissingsecurityupdates/script.txt | 3 --- steps/monitorwindowsupdatetask/script.txt | 3 ++- .../script.txt | 3 --- 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index aa22dcf..86f2c5e 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ This Project contains the following Blueprints. -### Patch Windows - Security +### Install PSWindowsUpdate Module -### Install PSWindowsUpdate Module +### Patch Windows - Security diff --git a/docs/Patch-Windows---Security.html b/docs/Patch-Windows---Security.html index 568a12d..4f27e27 100644 --- a/docs/Patch-Windows---Security.html +++ b/docs/Patch-Windows---Security.html @@ -425,14 +425,11 @@

Get-WUHistory -Last 15 -# Define a variable to filter for updates $SecurityUpdates = Get-WindowsUpdate -Category "Security" -# Check if there are missing updates if ($SecurityUpdates.Count -gt 0) { Write-Host "Missing Security Updates:" - # List the missing security updates $SecurityUpdates | ForEach-Object { Write-Host "KB$($_.KBArticleID): $($_.Title)" } @@ -579,10 +576,11 @@

                 
+Get-ScheduledTask -TaskName "PSWindowsUpdate"
 do {
     $scheduledTask = Get-ScheduledTask -TaskName "PSWindowsUpdate"
     Write-Host "PSWindowsUpdate task: $($scheduledTask.State)"
-    Start-Sleep -Seconds 30
+    Start-Sleep -Seconds 10
 } while ($scheduledTask.State -ne "Ready")
                 
             
@@ -643,7 +641,7 @@

Get-ScheduledTask -TaskName "PSWindowsUpdate" Unregister-ScheduledTask -TaskName "PSWindowsUpdate" -Confirm:$false } else { - Write-Host "PSWindowsUPdate isn't listed as a Scheduled Task." + Write-Host "PSWindowsUpdate isn't listed as a Scheduled Task." } @@ -799,6 +797,13 @@

+
+
+

+ +

+
+
@@ -843,14 +848,11 @@

Get-WUHistory -Last 15 -# Define a variable to filter for updates $SecurityUpdates = Get-WindowsUpdate -Category "Security" -# Check if there are missing updates if ($SecurityUpdates.Count -gt 0) { Write-Host "Missing Security Updates:" - # List the missing security updates $SecurityUpdates | ForEach-Object { Write-Host "KB$($_.KBArticleID): $($_.Title)" } diff --git a/docs/index.html b/docs/index.html index 7a1caff..0969b29 100644 --- a/docs/index.html +++ b/docs/index.html @@ -177,11 +177,11 @@
+ id="Install--PSWindowsUpdate-Module"> @@ -190,11 +190,11 @@

+ id="Patch-Windows---Security"> diff --git a/steps/cleanupwindowsupdatetask/script.txt b/steps/cleanupwindowsupdatetask/script.txt index 4ff5f39..096befe 100644 --- a/steps/cleanupwindowsupdatetask/script.txt +++ b/steps/cleanupwindowsupdatetask/script.txt @@ -4,5 +4,5 @@ if ($taskExists) { Get-ScheduledTask -TaskName "PSWindowsUpdate" Unregister-ScheduledTask -TaskName "PSWindowsUpdate" -Confirm:$false } else { - Write-Host "PSWindowsUPdate isn't listed as a Scheduled Task." + Write-Host "PSWindowsUpdate isn't listed as a Scheduled Task." } diff --git a/steps/listmissingsecurityupdates/script.txt b/steps/listmissingsecurityupdates/script.txt index 06a42e7..aa41a05 100644 --- a/steps/listmissingsecurityupdates/script.txt +++ b/steps/listmissingsecurityupdates/script.txt @@ -1,13 +1,10 @@ Get-WUHistory -Last 15 -# Define a variable to filter for updates $SecurityUpdates = Get-WindowsUpdate -Category "Security" -# Check if there are missing updates if ($SecurityUpdates.Count -gt 0) { Write-Host "Missing Security Updates:" - # List the missing security updates $SecurityUpdates | ForEach-Object { Write-Host "KB$($_.KBArticleID): $($_.Title)" } diff --git a/steps/monitorwindowsupdatetask/script.txt b/steps/monitorwindowsupdatetask/script.txt index e72c94d..bb1993f 100644 --- a/steps/monitorwindowsupdatetask/script.txt +++ b/steps/monitorwindowsupdatetask/script.txt @@ -1,5 +1,6 @@ +Get-ScheduledTask -TaskName "PSWindowsUpdate" do { $scheduledTask = Get-ScheduledTask -TaskName "PSWindowsUpdate" Write-Host "PSWindowsUpdate task: $($scheduledTask.State)" - Start-Sleep -Seconds 30 + Start-Sleep -Seconds 10 } while ($scheduledTask.State -ne "Ready") diff --git a/steps/verifythatsecurityupdatesareinstalled/script.txt b/steps/verifythatsecurityupdatesareinstalled/script.txt index 81046e4..b024c95 100644 --- a/steps/verifythatsecurityupdatesareinstalled/script.txt +++ b/steps/verifythatsecurityupdatesareinstalled/script.txt @@ -1,13 +1,10 @@ Get-WUHistory -Last 15 -# Define a variable to filter for updates $SecurityUpdates = Get-WindowsUpdate -Category "Security" -# Check if there are missing updates if ($SecurityUpdates.Count -gt 0) { Write-Host "Missing Security Updates:" - # List the missing security updates $SecurityUpdates | ForEach-Object { Write-Host "KB$($_.KBArticleID): $($_.Title)" }