From d3ffecf845af9073f8a7d1f6c60a7082bd621c0c Mon Sep 17 00:00:00 2001 From: Austin <30052685+awarre@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:17:00 -0400 Subject: [PATCH] Fix to $iisPath Get-WsusIISLocalizedNamespacePath was being called before it was declared. --- Optimize-WsusServer.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Optimize-WsusServer.ps1 b/Optimize-WsusServer.ps1 index d49da1f..6472ca0 100644 --- a/Optimize-WsusServer.ps1 +++ b/Optimize-WsusServer.ps1 @@ -41,7 +41,7 @@ Declines all updates that have been approved and are superseded by other updates Creates a scheduled task to run the OptimizeDatabase function weekly. .NOTES - Version: 1.2.0 + Version: 1.2.1 Author: Austin Warren Creation Date: 2020/07/31 @@ -94,8 +94,6 @@ $recommendedIISSettings = @{ ClientExecutionTimeout = 7200 } -$iisPath = Get-WsusIISLocalizedNamespacePath - <# DeepClean @@ -963,6 +961,7 @@ function Decline-SupersededUpdates ($verbose){ } } #-----------------------------------------------------------[Execution]------------------------------------------------------------ +$iisPath = Get-WsusIISLocalizedNamespacePath # Check commandline parameters. switch($true) {