<# .SYNOPSIS Search a downloaded Austrian aircraft register database for an aircraft registation and if found, return the aircraft manufacturer and model (tab-delimited) .DESCRIPTION First, create a subdirectory 'OE' in this script's parent folder. Next, download the Austrian aircraft register database (see links section), unzip it and move the PDF file to the 'OE' folder. Now run this script with an aircraft registration as its only parameter (see examples section). The script cannot read the PDF file directly, so the PDF file needs to be converted to plain text first. The script will look for a GhostScript installation on the computer, and if found, uses the following command to convert the PDF file to plain text: "C:\Program Files\gs\gs\bin\gswin64c.exe" -sDEVICE=txtwrite -o Gesamt__EN.txt Gesamt__EN.pdf NOTE: If you download a new PDF file, make sure to either run this script with the -ConvertPDF switch or manually delete the old TEXT file! After removing "OE-" from the registration, the script will search for a line that starts with the remainder of the registration. If a match is found, the manufacturer will be in the same line, more to the right, and the model will be on the next line right below the manufacturer. The script will display a tab-delimited string with the registration, the manufacturer and the aircraft model (). If the script was started by another PowerShell script, the calling PowerShell script may also read the manufacturer and model from the variables $Manufacturer and $Model, passed on by this script. If the script was started by a batch file, the calling batch file can use 'FOR /F' on this PowerShell script's screen output to find the manufacturer and model. Get-Help './AirRegOECmd.ps1' -Examples will show 2 examples of this script being called by another script. .PARAMETER Registration A valid Austrian aircraft registration, i.e. OE-xxx (where each x is a single character) .PARAMETER ConvertPDF Force conversion of the latest PDF file to plain text; use this switch once after downloading a new PDF file. .PARAMETER Quiet Ignore all errors and do not display any error messages; in case of errors, just terminate with return code 1. .PARAMETER Help Show the script's help screen .PARAMETER Version Show this script's version number; if combined with -Verbose show full script path, version number and last/modified/release date .PARAMETER Debug Show some progress messages .OUTPUTS A tab-delimited string and manufacturer and model are also stored in output variables $Manufacturer and $Model. .EXAMPLE . ./AirRegOECmd.ps1 "OE-AKJ" Will return tab-delimited string "OE-AKJBoeing Commercial Airplane GroupE75", and set variables $Manufacturer to "BOEING" and $Model to "E75N1" .EXAMPLE "OE-AKJ" | . ./AirRegOECmd.ps1 Will also return tab-delimited string "OE-AKJBoeing Commercial Airplane GroupE75", and set variables $Manufacturer to "BOEING" and $Model to "E75N1" .EXAMPLE . ./AirRegOECmd.ps1 "OE-AKJ" -Debug This will return: Start searching AHA in carscurr.txt file at