{"id":3282,"date":"2013-07-03T11:59:00","date_gmt":"2013-07-03T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/07\/03\/powertip-import-only-aliases-and-functions-from-a-powershell-module\/"},"modified":"2013-07-03T11:59:00","modified_gmt":"2013-07-03T11:59:00","slug":"powertip-import-only-aliases-and-functions-from-a-powershell-module","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-import-only-aliases-and-functions-from-a-powershell-module\/","title":{"rendered":"PowerTip: Import Only Aliases and Functions from a PowerShell Module"},"content":{"rendered":"<p><strong style=\"font-size: 12px\">Summary<\/strong><span style=\"font-size: 12px\">: Use parameters of&nbsp;<\/span><strong style=\"font-size: 12px\">Import-Module<\/strong><span style=\"font-size: 12px\">&nbsp;to control what you import from a Windows PowerShell module.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;How can I import only custom aliases and functions from a Windows PowerShell module?<\/p>\n<p style=\"padding-left: 60px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;1. Use the <strong>&ndash;Function <\/strong>and&nbsp;<strong>&ndash;Alias<\/strong>&nbsp;parameters, and use wildcard characters to control the import (<strong>ipmo<\/strong>&nbsp;is an alias for&nbsp;<strong>Import-Alias<\/strong>):<\/p>\n<p style=\"padding-left: 150px\">ipmo pscx -Function * -Alias *<\/p>\n<p style=\"padding-left: 90px\">&nbsp; 2. Use the&nbsp;<strong>Get-Command<\/strong>&nbsp;cmdlet to verify the import (<strong>gcm<\/strong>&nbsp;is an alias for&nbsp;<strong>Get-Command<\/strong>&nbsp;and&nbsp;<strong>&ndash;mo<\/strong>&nbsp;is short for&nbsp;<strong>&ndash;Module<\/strong>):<\/p>\n<p style=\"padding-left: 150px\">gcm -mo pscx<\/p>\n<p style=\"padding-left: 90px\"><strong>&nbsp; Note<\/strong>&nbsp;&nbsp;&nbsp;For more information about the PSCX module, see&nbsp;<a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/07\/18\/install-the-pscx-and-80-new-cmdlets-to-ease-powershell-use.aspx\" target=\"_blank\">Install the PSCX and 80 New Cmdlets to Ease PowerShell Use<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\"\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use parameters of&nbsp;Import-Module&nbsp;to control what you import from a Windows PowerShell module. &nbsp;How can I import only custom aliases and functions from a Windows PowerShell module? &nbsp;1. Use the &ndash;Function and&nbsp;&ndash;Alias&nbsp;parameters, and use wildcard characters to control the import (ipmo&nbsp;is an alias for&nbsp;Import-Alias): ipmo pscx -Function * -Alias * &nbsp; 2. Use the&nbsp;Get-Command&nbsp;cmdlet to [&hellip;]<\/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":[1],"tags":[356,3,45],"class_list":["post-3282","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use parameters of&nbsp;Import-Module&nbsp;to control what you import from a Windows PowerShell module. &nbsp;How can I import only custom aliases and functions from a Windows PowerShell module? &nbsp;1. Use the &ndash;Function and&nbsp;&ndash;Alias&nbsp;parameters, and use wildcard characters to control the import (ipmo&nbsp;is an alias for&nbsp;Import-Alias): ipmo pscx -Function * -Alias * &nbsp; 2. Use the&nbsp;Get-Command&nbsp;cmdlet to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/3282","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=3282"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/3282\/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=3282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=3282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=3282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}