fix logging
This commit is contained in:
@@ -55,7 +55,7 @@ Function LogMsg {
|
|||||||
param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message)
|
param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message)
|
||||||
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||||
$LogEntry = "${Timestamp} - ${Message}"
|
$LogEntry = "${Timestamp} - ${Message}"
|
||||||
Add-Content -Path $LogFile -Value $LogEntry
|
Add-Content -Path $Global:LogFile -Value $LogEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
## Log an error to the log file
|
## Log an error to the log file
|
||||||
@@ -63,7 +63,7 @@ Function LogErr {
|
|||||||
param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message)
|
param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Message)
|
||||||
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
$Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||||
$LogEntry = "${Timestamp} - Error: ${Message}"
|
$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
|
## Function to determine if the current user context is an Administrator
|
||||||
|
|||||||
Reference in New Issue
Block a user