Add what-is.ps1

This commit is contained in:
Markus Fleschutz 2021-04-27 15:54:52 +02:00
parent c927d7263c
commit dc01730a4e
4 changed files with 64 additions and 1 deletions

View File

@ -182,9 +182,10 @@ turn-volume-down.ps1, turns the audio volume down (-10% by default)
unmute-audio.ps1, unmutes audio unmute-audio.ps1, unmutes audio
upload-file.ps1, uploads the local file to the given FTP server upload-file.ps1, uploads the local file to the given FTP server
voice-control.ps1, executes the PowerShell scripts by voice voice-control.ps1, executes the PowerShell scripts by voice
wakeup.ps1, sends a magic packet to the given computer, waking him up
weather.ps1, prints the current weather forecast weather.ps1, prints the current weather forecast
weather-report.ps1, prints the local weather report weather-report.ps1, prints the local weather report
wakeup.ps1, sends a magic packet to the given computer, waking him up what-is.ps1, prints a description of the given abbreviation
write-animated.ps1, writes animated text write-animated.ps1, writes animated text
write-big.ps1, writes the given text in big letters write-big.ps1, writes the given text in big letters
write-blue.ps1, writes the given text in a blue foreground color write-blue.ps1, writes the given text in a blue foreground color

Can't render this file because it has a wrong number of fields in line 185.

31
Data/what-is.csv Normal file
View File

@ -0,0 +1,31 @@
Abbr,Context,Description
AB,aviation,Air Base
AC,aviation,Aircraft
ACAS,aviation,Airborne Collision Avoidance System
AF,aviation,Air Field
AFM,aviation,Aircraft Flight Manual
AIP,aviation,Aeronautical Information Publication
AMAN,aviation,Arrival Manager
AOA,aviation,Angle of Attack
AOM,aviation,Airplane Operating Manual
AOR,aviation,Area of Responsibility
AFIS,aviation,Aerodrome Flight Information Service
AFM,aviation,Airplane Flight Manual
AGL,aviation,Above Ground Level
AIP,aviation,Aeronautical Information Publication
ANSP,aviation,Air Navigation Service Provider
ATA,aviation,Actual Time of Arrival
ATIS,aviation,Automatic Terminal Information Service
ATO,aviation,Air Traffic Organization
BAF,aviation,Belgian Air Force
CAAC,aviation,Civil Aviation Administration of China
CAAS,aviation,Civil Aviation Authorization of Singapore
CANSO,aviation,Civil Air Navigation Services Organization (founded 1996, located in Amsterdam)
CAS,aviation,Calibrated Airspeed
CAT,aviation,Category of aircraft
CAVOK,aviation,Ceiling And Visibility OK
COG,aviation,Center of Gravity
CRDA,aviation,Converging Runway Display Aid
CTA,aviation,Controlled Time of Arrival
CTOT,aviation,Calculated Take-Off Time
IAS,aviation,Indicated Air Speed
Can't render this file because it has a wrong number of fields in line 23.

View File

@ -212,6 +212,7 @@ Mega Collection of PowerShell Scripts
* [translate-text.ps1](Scripts/translate-text.ps1) - translates the given text in English into other languages * [translate-text.ps1](Scripts/translate-text.ps1) - translates the given text in English into other languages
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast * [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
* [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report * [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report
* [what-is.ps1](Scripts/what-is.ps1) - prints a description of the given abbreviation
* [write-animated.ps1](Scripts/write-animated.ps1) - writes animated text * [write-animated.ps1](Scripts/write-animated.ps1) - writes animated text
* [write-big.ps1](Scripts/write-big.ps1) - writes the given text in big letters * [write-big.ps1](Scripts/write-big.ps1) - writes the given text in big letters
* [write-blue.ps1](Scripts/write-blue.ps1) - writes the given text in a blue foreground color * [write-blue.ps1](Scripts/write-blue.ps1) - writes the given text in a blue foreground color

30
Scripts/what-is.ps1 Executable file
View File

@ -0,0 +1,30 @@
<#
.SYNTAX what-is.ps1 [<abbreviation>]
.DESCRIPTION prints a description of the given abbreviation
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Abbreviation = "")
if ($Abbreviation -eq "" ) { $Abbreviation = read-host "Enter the abbreviation" }
try {
write-progress "Reading what-is.csv..."
$Table = import-csv "$PSScriptRoot/../Data/what-is.csv"
$FoundOne = 0
foreach($Row in $Table) {
if ($Row.Abbr -eq $Abbreviation) {
"$($Row.Context): $($Row.Description)"
$FoundOne = 1
}
}
if ($FoundOne -eq 0) {
"Sorry, no entry for $Abbreviation found"
}
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}