Update the comment-based help

This commit is contained in:
Markus Fleschutz
2021-08-29 17:50:03 +02:00
parent 11ca126b33
commit e10261351c
249 changed files with 780 additions and 1021 deletions

View File

@ -2,20 +2,19 @@
.SYNOPSIS
what-is.ps1 [<abbreviation>]
.DESCRIPTION
Prints a description of the given abbreviation
Prints a description of the given abbreviation.
.EXAMPLE
PS> .\what-is.ps1 CIA
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz
License: CC0
#>
param([string]$Abbreviation = "")
param([string]$abbreviation = "")
try {
if ($Abbreviation -eq "" ) { $Abbreviation = read-host "Enter the abbreviation" }
if ($abbreviation -eq "" ) { $abbreviation = read-host "Enter the abbreviation" }
write-progress "Searching ..."
@ -25,7 +24,7 @@ try {
foreach ($File in $Files) {
$Table = import-csv "$File"
foreach($Row in $Table) {
if ($Row.Abbreviation -eq $Abbreviation) {
if ($Row.Abbreviation -eq $abbreviation) {
$Basename = (get-item "$File").Basename
"$($Row.Abbreviation) = $($Row.Definition) in $Basename"
$FoundOne = $true
@ -33,7 +32,7 @@ try {
}
}
if ($FoundOne -eq $false) { "Sorry, no entry for $Abbreviation found" }
if ($FoundOne -eq $false) { "Sorry, no entry for $abbreviation found" }
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"