Rename to list-memos.ps1

This commit is contained in:
Markus Fleschutz 2021-05-04 16:39:06 +02:00
parent d12a27ace0
commit 7c41820f13
5 changed files with 34 additions and 33 deletions

View File

@ -1,2 +0,0 @@
Time,User,Text
2020-12-24T09:24:30Z,mf,Hello World
1 Time User Text
2 2020-12-24T09:24:30Z mf Hello World

View File

@ -98,7 +98,7 @@ list-hidden-files.ps1, lists hidden files within the given directory tree
list-installed-apps.ps1, lists the installed Windows Store apps
list-installed-software.ps1, lists the installed software (except Windows Store apps)
list-latest-tag.ps1, lists the latest tag on the current branch in a Git repository
list-logbook.ps1, lists the content of the logbook
list-memos.ps1, lists the memos at $HOME/Memos.csv
list-unused-files.ps1, lists unused files in a directory tree
list-cmdlets.ps1, lists the PowerShell cmdlets
list-earthquakes.ps1, lists earthquakes with magnitude >= 6.0 for the last 30 days

1 Script Description
98 list-installed-apps.ps1 lists the installed Windows Store apps
99 list-installed-software.ps1 lists the installed software (except Windows Store apps)
100 list-latest-tag.ps1 lists the latest tag on the current branch in a Git repository
101 list-logbook.ps1 list-memos.ps1 lists the content of the logbook lists the memos at $HOME/Memos.csv
102 list-unused-files.ps1 lists unused files in a directory tree
103 list-cmdlets.ps1 lists the PowerShell cmdlets
104 list-earthquakes.ps1 lists earthquakes with magnitude >= 6.0 for the last 30 days

View File

@ -190,8 +190,8 @@ Mega Collection of PowerShell Scripts
* [list-emojis.ps1](Scripts/list-emojis.ps1) - lists the emojis of Unicode 13.0
* [list-fritzbox-calls.ps1](Scripts/list-fritzbox-calls.ps1) - lists the FRITZ!Box calls
* [list-fritzbox-devices.ps1](Scripts/list-fritzbox-devices.ps1) - lists FRITZ!Box's known devices
* [list-logbook.ps1](Scripts/list-logbook.ps1) - lists the content of the logbook
* [list-earthquakes.ps1](Scripts/list-earthquakes.ps1) - lists earthquakes with magnitude >= 6.0 for the last 30 days
* [list-memos.ps1](Scripts/list-memos.ps1) - lists the memos at $HOME/Memos.csv
* [list-mysql-tables.ps1](Scripts/list-mysql-tables.ps1) - lists the MySQL server tables
* [list-news.ps1](Scripts/list-news.ps1) - lists the latest news
* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists operating system releases and download URL

View File

@ -1,29 +0,0 @@
<#
.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 in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

32
Scripts/list-memos.ps1 Executable file
View File

@ -0,0 +1,32 @@
<#
.SYNTAX list-memos.ps1
.DESCRIPTION lists the memos at $HOME/Memos.csv
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$Path = "$HOME/Memos.csv"
if (test-path "$Path") {
write-progress "Reading $Path ..."
$Table = import-csv "$Path"
write-progress -completed "Reading $Path"
""
"Time User Text"
"---- ---- ----"
foreach($Row in $Table) {
$Time = $Row.Time
$User = $Row.User
$Text = $Row.Text
"$Time $User $Text"
}
} else {
"Sorry, no $Path file found"
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}