PowerShell Function to Find Parameter Aliases

While sitting through Jeff Hicks‘ Advanced PowerShell Scripting Workshop at PowerShell on the River in Chattanooga today, he mentioned there being a “Cn” alias for the ComputerName parameter of commands in PowerShell.

I’ve previously written a one-liner to find parameter aliases and at one time Microsoft had starting adding parameter aliases to the help for commands as referenced in that same blog article, but it appears that they’ve discontinued adding them to the help and removed the ones they previously added to it.

I thought I would polish the one-liner I had posted back in 2012 in the previously referenced blog article and turn it into a PowerShell function as shown in the following example.

The Find-MrParameterAlias function shown in this blog article can be found in my PowerShell repository on GitHub.

Thoughts, questions, comments? Please post them as a comment to this blog article.

µ

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: