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