mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 17:14:28 +01:00
31 lines
796 B
PowerShell
Executable File
31 lines
796 B
PowerShell
Executable File
#!/usr/bin/pwsh
|
|
<#
|
|
.SYNTAX list-logbook.ps1
|
|
.DESCRIPTION lists the content of the logbook (in ../Data/logbook.csv)
|
|
.LINK https://github.com/fleschutz/PowerShell
|
|
.NOTES Author: Markus Fleschutz / License: CC0
|
|
#>
|
|
|
|
$PathToRepo = "$PSScriptRoot/.."
|
|
|
|
try {
|
|
write-progress "Reading Data/logbook.csv..."
|
|
$Table = import-csv "$PathToRepo/Data/logbook.csv"
|
|
write-progress -completed "Reading Data/logbook.csv..."
|
|
|
|
write-output ""
|
|
write-output "Time User Text"
|
|
write-output "---- ---- ----"
|
|
foreach($Row in $Table) {
|
|
$Time = $Row.Time
|
|
$User = $Row.User
|
|
$Text = $Row.Text
|
|
write-output "$Time $User $Text"
|
|
}
|
|
write-output ""
|
|
exit 0
|
|
} catch {
|
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
exit 1
|
|
}
|