June 23rd, 2006

Cleaning up obsolete Windows PowerShell Aliases

PowerShell Team
PowerShell Team

Over the course of time, I’ve written a number of functions & cmdlets and then created aliases for those.  Many of those where Ad Hoc and I’ve since thrown them away but I still have the aliases sticking around.  Here is a quick and easy way to determine the validity of your aliases

gal |%{if (!(gcm $_.Definition -ea SilentlyContinue)) {$_}}

Enjoy!
Jeffrey Snover
Windows PowerShell Architect

PSMDTAG:ENVIRONMENT: cleaning up Aliases

Category
PowerShell

Author

PowerShell Team
PowerShell Team

PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.

0 comments

Discussion are closed.

Feedback