Auto-CaseCorrecting PowerShell Code

by Oct 21, 2015

Often when you write PowerShell scripts, you may not have used the correct casing, used only partial parameter names, or used aliases instead of cmdlet names. All of this is technically OK because PowerShell commands are case-insensitive, parameter names can be abbreviated, and aliases are a valid command type.

However, scripts become more readable when you use correct casing, full parameter names, and cmdlet names instead of alias names.

In the PowerShell ISE, to correct these things, simply place your cursor in a command name or parameter name, then press TAB. Tabexpansion will take your existing code and replace it with the case-corrected full-named version.

Twitter This Tip! ReTweet this Tip!