PowerShell: Write-Log
# Location of the Log File $logFile = $env:TEMP + "\LogFile.log" Function Write-Log { Param ([string]$logString) Add-Content -Path $logFile -Value ($(get-date -f MM-dd-yyyy_HH_mm_ss) + ": " + $logString) }