Wednesday, December 13, 2006

PowerGadgets out-map: pseudo parameter aliases

OK, these are not really parameter aliases, but just "shortcuts"... Parameter aliases need to be coded directly in the cmdlet, but there's another way.

(Formatting is off...)

Would you rather type this:

PS C:\> import-csv country.csv [pipe] out-map -mapsource World\WorldCountries -title test -label Country -values Points -conditionalattributes_0_condition_from 0 -conditionalattributes_0_condition_to 10 -conditionalattributes_0_color Red -conditionalattributes_0_text "0 to 10" -conditionalattributes_1_condition_from 11 -conditionalattributes_1_condition_to 20 -conditionalattributes_1_color Blue -conditionalattributes_1_text "11 to 20" -palette "highcontrast"

Or this:
PS C:\> .\out-map2.ps1 -csv country.csv -map_world -la Country -va Points -from_0 0 -to_0 10 -co_0 Red -te "0 to 10" -from_1 11 -to_1 20 -co_1 Blue -te_1 "11 to 20" -pa "highcontrast"

Running any combination of out-map2.ps1 with the flag "-test" as the first argument will just output the command that would have been run so you can check for the proper formatting.

out-map2.ps1: out-map2.ps1