mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-13 14:37:19 +02:00
Update the comment-based help
This commit is contained in:
@ -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])"
|
||||
|
Reference in New Issue
Block a user