August 17th, 2014

PowerTip: Find PowerShell Canonical Aliases

Doctor Scripto
Scripter

Summary: Find Windows PowerShell aliases that are read-only and available in all scopes.

Hey, Scripting Guy! Question How can I produce a list of Windows PowerShell aliases that are read-only and are available in
           all Windows PowerShell scopes?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet to produce a list of aliases, filter on aliases that have an option of read-only,
           and select the name, definition, and options:

Get-Alias | Where options -match 'readonly' | select name, definition, options

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback