mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 13:27:41 +02:00
Improved timestamps in logbook
This commit is contained in:
@ -8,16 +8,14 @@
|
||||
|
||||
param([String]$Text)
|
||||
try {
|
||||
$Time = Get-Date -format "yyyy-MM-ddTHH:mm:ssZ" -AsUTC
|
||||
$User = $(whoami)
|
||||
if ($Text -eq "" ) {
|
||||
[String]$Text = read-host "Enter text to write"
|
||||
}
|
||||
$Line = "$Time,$User,$Text"
|
||||
|
||||
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
|
||||
|
||||
$Timestamp = Get-Date -format "yyyy-MM-dd HH:mm:ss" -AsUTC
|
||||
$UserName = $(whoami)
|
||||
$Line = "$Timestamp,$UserName,$Text"
|
||||
|
||||
write-output $Line >> "$PathToRepo/Data/Logbook.csv"
|
||||
exit 0
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user