Improve the done output

This commit is contained in:
Markus Fleschutz
2021-08-24 20:46:03 +02:00
parent 13d4bc48e3
commit 86a0db9640
31 changed files with 59 additions and 47 deletions

View File

@ -12,17 +12,18 @@
License: CC0
#>
param([string]$Text = "")
if ($Text -eq "" ) { $Text = read-host "Enter the memo text to add" }
param([string]$text = "")
try {
if ($text -eq "" ) { $text = read-host "Enter the memo text to add" }
$Path = "$HOME/Memos.csv"
$Time = get-date -format "yyyy-MM-ddTHH:mm:ssZ" -asUTC
$User = $(whoami)
$Line = "$Time,$User,$Text"
$Line = "$Time,$User,$text"
if (-not(test-path "$Path" -pathType leaf)) {
write-output "Time,User,Text" > "$Path"
write-output "Time,User,text" > "$Path"
}
write-output $Line >> "$Path"