Improve usage of test-path

This commit is contained in:
Markus Fleschutz
2021-06-07 08:48:17 +02:00
parent a39508856b
commit 7a57971d0c
4 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@ try {
$User = $(whoami)
$Line = "$Time,$User,$Text"
if (-not(test-path "$Path")) {
if (-not(test-path "$Path" -pathType leaf)) {
write-output "Time,User,Text" > "$Path"
}
write-output $Line >> "$Path"