<# .SYNOPSIS Search a downloaded Swiss aircraft registry database for a Swiss aircraft registation and if found, return the aircraft manufacturer and model (tab-delimited) .DESCRIPTION First, create a subdirectory 'HB' in this script's parent folder. Next, download the Swiss aircraft registry database in CSV format (see links section), and move the file 'Swiss Aircraft Register.csv' to the 'HB' folder. Now run this script with an Australian aircraft registration as its only parameter (see examples section). The script will first look for the specified registration code in column 2 of the 'Swiss Aircraft Register.csv' file. If a match is found, the manufacturer and model are found in columns 6 and 7. 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 './AirRegHBCmd.ps1' -Examples will show 2 examples of this script being called by another script. .PARAMETER Registration A valid Swiss aircraft registration, e.g. HB-1044 .PARAMETER Quiet Ignore all errors and do not display any error messages; in case of errors, just terminate with return code 1. .PARAMETER Version Show this script's version number; if combined with -Verbose show full script path, version number and last/modified/release date .PARAMETER CheckDB If the required local database can be found, returns True and exit code 0; if not, returns False and exit code 1. .PARAMETER Help Show the script's help screen .PARAMETER Debug Show some progress messages .OUTPUTS If a match is found: a tab-delimited string with , and if -NoBreak switch is used: variables $Manufacturer set to aircraft manufacturer $Model set to aircraft model If no match is found: False .EXAMPLE . ./AirRegHBCmd.ps1 HB-1044 Will return tab-delimited string "HB-1044SEGELFLUGZEUGBAU A. NEUKOMAN 66 C", and set variables $Manufacturer to "HB-1044 SEGELFLUGZEUGBAU A. NEUKOM" and $Model to "AN 66 C" .EXAMPLE "HB-1044" | . ./AirRegHBCmd.ps1 Will also return tab-delimited string HB-1044SEGELFLUGZEUGBAU A. NEUKOMAN 66 C", and set variables $Manufacturer to "HB-1044 SEGELFLUGZEUGBAU A. NEUKOM" and $Model to "AN 66 C" .EXAMPLE . ./AirRegHBCmd.ps1 "HB-1044" -Debug This will return: Start searching "HB-1044" in "Swiss Aircraft Register.csv" file at