{"id":10161,"date":"2006-06-23T19:52:00","date_gmt":"2006-06-23T19:52:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2006\/06\/23\/cleaning-up-obsolete-windows-powershell-aliases\/"},"modified":"2019-02-18T13:21:38","modified_gmt":"2019-02-18T20:21:38","slug":"cleaning-up-obsolete-windows-powershell-aliases","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/cleaning-up-obsolete-windows-powershell-aliases\/","title":{"rendered":"Cleaning up obsolete Windows PowerShell Aliases"},"content":{"rendered":"<p>Over the course of time, I&#8217;ve written a number of functions &amp; cmdlets and then created aliases for those.&nbsp; Many of those where Ad Hoc and I&#8217;ve since thrown them away but I still have the aliases sticking around.&nbsp; Here is a quick and easy way to determine the validity of your aliases<\/p>\n<p>gal |%{if (!(gcm $_.Definition -ea SilentlyContinue)) {$_}}<\/p>\n<p>Enjoy!<br \/>Jeffrey Snover<br \/>Windows PowerShell Architect<\/p>\n<p>PSMDTAG:ENVIRONMENT: cleaning up Aliases<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the course of time, I&#8217;ve written a number of functions &amp; cmdlets and then created aliases for those.&nbsp; Many of those where Ad Hoc and I&#8217;ve since thrown them away but I still have the aliases sticking around.&nbsp; Here is a quick and easy way to determine the validity of your aliases gal |%{if [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[29],"class_list":["post-10161","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-environment"],"acf":[],"blog_post_summary":"<p>Over the course of time, I&#8217;ve written a number of functions &amp; cmdlets and then created aliases for those.&nbsp; Many of those where Ad Hoc and I&#8217;ve since thrown them away but I still have the aliases sticking around.&nbsp; Here is a quick and easy way to determine the validity of your aliases gal |%{if [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=10161"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/10161\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=10161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=10161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=10161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}