<# .SYNOPSIS Search a downloaded French Agence Nationale des Titres Sécurisés aircraft registry database for a French aircraft registation and if found, return the aircraft manufacturer and model (tab-delimited) .DESCRIPTION First, create a subdirectory 'F' in this script's parent folder. Next, download the Agence Nationale des Titres Sécurisés aircraft registry database (see links section, use link marked 'Données du registre' on the website), move the file export.csv to the 'F' folder. Now run this script with a French aircraft registration as its only parameter (see examples section). The script will first look for the specified registration code in column 1 of the export.csv file. If a match is found, the manufacturer and model are found in columns 2 and 3. 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 './AirRegFCmd.ps1' -Examples will show 2 examples of this script being called by another script. .PARAMETER Registration A valid French aircraft registration, e.g. F-AZXN .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 . ./AirRegFCmd.ps1 F-AZXN Will return tab-delimited string "F-AZXNTHE BOEING COMPANYSTEARMAN A 75/N1", and set variables $Manufacturer to "THE BOEING COMPANY" and $Model to "STEARMAN A 75/N1" .EXAMPLE "F-AZXN" | . ./AirRegFCmd.ps1 Will also return tab-delimited string "F-AZXNTHE BOEING COMPANYSTEARMAN A 75/N1", and set variables $Manufacturer to "THE BOEING COMPANY" and $Model to "STEARMAN A 75/N1" .EXAMPLE . ./AirRegFCmd.ps1 "F-AZXN" -Debug This will return: Start searching F-AZXN in export.csv file at