# Asset from: https://assets.kelpw.ing/script/logging.ps1 $ESC = [char]27 function info { param( [Parameter(Mandatory = $false, Position = 0)] [string]$msg ) Write-Host ("[{0}[94mINFO{1}[0m] {2}" -f $ESC, $ESC, $msg) } function warn { param( [Parameter(Mandatory = $false, Position = 0)] [string]$msg ) Write-Host ("[{0}[93mWARN{1}[0m] {2}" -f $ESC, $ESC, $msg) } function error { param( [Parameter(Mandatory = $false, Position = 0)] [string]$msg ) Write-Host ("[{0}[91mERROR{1}[0m] {2}" -f $ESC, $ESC, $msg) } function success { param( [Parameter(Mandatory = $false, Position = 0)] [string]$msg ) Write-Host ("[{0}[92mSUCCESS{1}[0m] {2}" -f $ESC, $ESC, $msg) } function fatal { param( [Parameter(Mandatory = $false, Position = 0)] [string]$msg ) Write-Host ("[{0}[91mFATAL{1}[0m] {2}" -f $ESC, $ESC, $msg) Read-Host "Press any key to continue..." exit 1 } # End of logging functions