{"id":86533,"date":"2019-10-16T13:00:28","date_gmt":"2019-10-16T21:00:28","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/scripting\/?p=86533"},"modified":"2019-10-15T20:19:21","modified_gmt":"2019-10-16T04:19:21","slug":"powertip-use-new-alias-to-make-cmdlets-easier-to-remember","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-new-alias-to-make-cmdlets-easier-to-remember\/","title":{"rendered":"PowerTip: Use New-Alias to make Cmdlets easier to remember"},"content":{"rendered":"<p><strong>Summary<\/strong>: Using New-Alias to create easier to remember shortcuts to Cmdlets in PowerShell<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86534\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/a-picture-containing-scissors-description-automat-4.jpeg\" alt=\"A picture containing scissors\n\nDescription automatically generated\" \/><\/p>\n<p>Hey, Doctor Scripto. I know I can use Install-Module to download a DSC Resource, but is there some way to build a Cmdlet that does the Exact same job but call it Install-DSCResource? I would find that easier to remember when getting them (DSCResources).<\/p>\n<p><img decoding=\"async\" width=\"34\" height=\"34\" class=\"wp-image-86535\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/word-image-4.jpeg\" \/><\/p>\n<p>We can\u2019t create a new Cmdlet, but we can create an Alias. It will respond to all the same parameters as the original. To make an Alias of Install-Module that says Install-DSCResource just execute the following line.<\/p>\n<p><strong>New-Alias -Name Install-DSCResource -value Install-Module -description \u2018Alias for Install-Module\u2019<\/strong><\/p>\n<p><img decoding=\"async\" width=\"96\" height=\"145\" class=\"wp-image-86536\" src=\"http:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/10\/word-image-9.png\" \/><\/p>\n<p>PowerShell, Doctor Scripto, PowerTip, Sean Kearney<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using New-Alias to create easier to remember shortcuts in PowerShell<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1739,1738,639],"tags":[1740,377,356,154],"class_list":["post-86533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-doctor-scripto","category-powershell","category-powertip","tag-doctor-scripto","tag-powershell","tag-powertip","tag-sean-kearney"],"acf":[],"blog_post_summary":"<p>Using New-Alias to create easier to remember shortcuts in PowerShell<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=86533"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/86533\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=86533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=86533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=86533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}