2020-12-24 10:44:10 +01:00
|
|
|
#!/snap/bin/powershell
|
2020-12-29 15:14:21 +01:00
|
|
|
<#
|
|
|
|
.SYNTAX ./list-logbook.ps1
|
2020-12-29 15:48:24 +01:00
|
|
|
.DESCRIPTION lists the content of the logbook (in ../Data/logbook.csv)
|
2020-12-29 15:14:21 +01:00
|
|
|
.LINK https://github.com/fleschutz/PowerShell
|
|
|
|
.NOTES Author: Markus Fleschutz / License: CC0
|
|
|
|
#>
|
2020-12-24 10:44:10 +01:00
|
|
|
|
2021-01-02 11:08:59 +01:00
|
|
|
$PathToRepo = "$PSScriptRoot/.."
|
|
|
|
|
2020-12-24 10:44:10 +01:00
|
|
|
try {
|
2020-12-29 15:48:24 +01:00
|
|
|
write-progress "Reading Data/logbook.csv..."
|
|
|
|
$Table = import-csv "$PathToRepo/Data/logbook.csv"
|
2021-01-09 12:54:32 +01:00
|
|
|
write-progress -completed "Reading Data/logbook.csv..."
|
2020-12-24 10:44:10 +01:00
|
|
|
|
|
|
|
write-output ""
|
2020-12-25 11:57:09 +01:00
|
|
|
write-output "Time User Text"
|
2020-12-24 10:44:10 +01:00
|
|
|
write-output "---------------------------------------------------------------"
|
|
|
|
foreach($Row in $Table) {
|
2020-12-25 11:57:09 +01:00
|
|
|
$Time = $Row.Time
|
|
|
|
$User = $Row.User
|
2020-12-24 10:44:10 +01:00
|
|
|
$Text = $Row.Text
|
|
|
|
write-output "$Time ($User) $Text"
|
|
|
|
}
|
|
|
|
write-output ""
|
|
|
|
exit 0
|
|
|
|
} catch {
|
|
|
|
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
|
|
exit 1
|
|
|
|
}
|