From 049480e8c48172b22a7bcb60fb1ed25382d6b6a8 Mon Sep 17 00:00:00 2001 From: dyoder Date: Thu, 12 Aug 2021 17:50:47 -0400 Subject: [PATCH] fix logging --- Tools.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools.ps1 b/Tools.ps1 index 43db34d..7611e20 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -55,7 +55,7 @@ Function LogMsg { param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message) $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $LogEntry = "${Timestamp} - ${Message}" - Add-Content -Path $LogFile -Value $LogEntry + Add-Content -Path $Global:LogFile -Value $LogEntry } ## Log an error to the log file @@ -63,7 +63,7 @@ Function LogErr { param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message) $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $LogEntry = "${Timestamp} - Error: ${Message}" - Add-Content -Path $LogFile -Value $LogEntry + Add-Content -Path $Global:LogFile -Value $LogEntry } ## Function to determine if the current user context is an Administrator