fix logging

This commit is contained in:
2021-08-12 17:50:47 -04:00
parent 11bb0e0327
commit 049480e8c4
+2 -2
View File
@@ -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