From 91e5567de65a66aa1a45f26942dd7ff13b3f5d6c Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Fri, 3 Jan 2025 23:02:46 -0500 Subject: [PATCH] Update SVSTaskGate.ps1 --- SVSTaskGate.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SVSTaskGate.ps1 b/SVSTaskGate.ps1 index d67b495..a27e939 100644 --- a/SVSTaskGate.ps1 +++ b/SVSTaskGate.ps1 @@ -6,7 +6,9 @@ # --------------------------------------------------------------------------- # 1) CREATE A GLOBAL LOG CACHE (NEW) # --------------------------------------------------------------------------- -$Global:LogCache = New-Object System.Collections.ArrayList +if (-not $Global:LogCache -or -not ($Global:LogCache -is [System.Collections.ArrayList])) { + $Global:LogCache = New-Object System.Collections.ArrayList +} # Check if the Write-Log function exists