Richard has a post on his blog about this The Over Use of Aliases?
I dont like duplicating other peoples post, but I think this one is worth it.
If you are an experienced Powershell person and you provide help or scripts to people. PLEASE do not use aliases. It makes it very hard for people. I am guilty myself. I mean gc % ? gm are SO tempting, but it really doesn’t help the person learn (it may even hinder.) IMO, using aliases can confuse newcomers… remember to them when you type gc… they think it is gc.exe not get-content. Peoples first impression is key… lets not make it a confusing one 🙂
Basically, I think aliases are best use for interactive use, but should be avoided in scripts or sample code.
p.s. COMMENT… COMMENT… COMMENT… Comments in code help a ton for people learning.
Jeffrey brought up a good point that I over looked. Numerous Powershell IDE’s like PrimalScript and Powershell Analzyer automatically expand built in aliases. I find this very useful. I will be writing another post about IDE’s and why I think they are VERY important.
2 Responses to “Using Aliases in Scripts or in your Examples.”
Leave a Reply
You must be logged in to post a comment.