Cleaning up obsolete Windows PowerShell Aliases

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)) {$_}}

Jeffrey Snover
Windows PowerShell Architect

PSMDTAG:ENVIRONMENT: cleaning up Aliases


Comments are closed. Login to edit/delete your existing comments

Feedback usabilla icon