CTP: Get-AliasSuggestion Rewritten to us CTP functions

I’m really enjoying the book Windows PowerShell Cookbook by Lee Holmes. It has lots of neat scripts. I decided to grab one and re-write it to highlight some of the features in the PowerShell V2 CTP.

Below is the content for Get-AliasSuggestion.PS1

#requires -Version 2# Name: Get-AliasSuggestion# Author: Jeffrey Snover # Derived From: Lee Holmes# This uses the CTP features of PowerShell V2 which may change# which would cause this script to change. cmdletparam(# Version 2 (CTP) supports attributes on parameters.# These attributes cause the engine to do work for us [Mandatory] [Position(0)] [Alias(“commandline”,”Cmd”,”Line”)] $lastCommand)# Version 2 (CTP) supports a DATA language which can be used for# globalizing your scriptdata msgs { # Replace this with your own culture/string if ($UICulture -eq “en-US”) { @{ Suggestion = “Suggestion: An alias for [{0}] is [{1}]” } }else { @{ Suggestion = “Suggestion: An alias for [{0}] is [{1}]” } }}