Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Guideline suggestion: avoid using aliases for builtin cmdlets #152

Open
jberezanski opened this issue Nov 30, 2016 · 0 comments
Open

Guideline suggestion: avoid using aliases for builtin cmdlets #152

jberezanski opened this issue Nov 30, 2016 · 0 comments

Comments

@jberezanski
Copy link

Aliases reduce script readability in many cases and may make scripts less robust (because they can be redefined by the user).

Here are a few statements on the topic:

https://blogs.msdn.microsoft.com/powershell/2006/04/25/is-it-safe-to-use-aliases-in-scripts/
https://blogs.technet.microsoft.com/heyscriptingguy/2011/05/01/best-practice-for-using-aliases-in-powershell-scripts/
https://poshoholic.com/2007/09/06/essential-powershell-avoid-shorthand-in-shared-powershell-scripts/

There is also a PSScriptAnalyzer rule for avoiding aliases: https://github.com/PowerShell/PSScriptAnalyzer/blob/development/RuleDocumentation/AvoidAlias.md

As there may be a lot of existing package scripts that use aliases, this definitely should not be a requirement (at least for the time being), but it would work as a Guideline, I think.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant