{"id":5631,"date":"2008-08-09T22:01:02","date_gmt":"2008-08-09T22:01:02","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2008\/08\/09\/all-about-modules\/"},"modified":"2019-02-18T13:13:04","modified_gmt":"2019-02-18T20:13:04","slug":"all-about-modules","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/all-about-modules\/","title":{"rendered":"All About Modules"},"content":{"rendered":"<p>One of the coolest new features of Windows PowerShell is PowerShell modules.&#160; I&#8217;ve just written a <a href=\"http:\/\/blogs.msdn.com\/mediaandmicrocode\/archive\/2008\/08\/10\/microcode-all-about-modules-windows-powershell-ctp2.aspx\">tutorial about how to use them on my personal blog<\/a>.<\/p>\n<p>You can check out the full post for more details, but here are some easy things to remember about modules:<\/p>\n<ul>\n<li>Modules can be scripts with functions, scripts that include other functions, or assemblies (DLLs) containing Cmdlets or providers <\/li>\n<li>Modules let you cleanly separate code <\/li>\n<li>Modules make it easy to depend on other code <\/li>\n<li>Modules can contain private variables or functions <\/li>\n<li>Modules let you refer to functions more explicitly (with &amp; (Get-Module <em>ModuleName) FunctionName<\/em><em> <\/em>) <\/li>\n<li><strong>You can take any .PS1 file that contains functions, and save it as a .PSM1, and you have made a module<\/strong><\/li>\n<\/ul>\n<p>The module examples also include a few PowerShell functions you might use in day-to-day life, such as being able to <a href=\"http:\/\/blogs.msdn.com\/mediaandmicrocode\/archive\/2008\/07\/13\/microcode-windows-powershell-windows-desktop-search-problem-solving.aspx\">Search-WindowsDesktop<\/a>, <a href=\"http:\/\/blogs.msdn.com\/mediaandmicrocode\/archive\/2008\/07\/21\/microcode-cleaning-up-get-recordedtv-with-select-object.aspx\">Get-RecordedTV<\/a>, or <a href=\"http:\/\/blogs.msdn.com\/mediaandmicrocode\/archive\/2008\/07\/21\/microcode-cleaning-up-dvr-with-get-recordedtv.aspx\">Remove-RecordedTVBySeries<\/a>, and are a great practical example of how you can use modules to cleanly separate code.&#160;&#160; <a href=\"http:\/\/blogs.msdn.com\/mediaandmicrocode\/archive\/2008\/08\/10\/microcode-all-about-modules-windows-powershell-ctp2.aspx\">Check it out<\/a>.<\/p>\n<p>Hope this helps,<\/p>\n<p>James Brundage [MSFT]   <\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the coolest new features of Windows PowerShell is PowerShell modules.&#160; I&#8217;ve just written a tutorial about how to use them on my personal blog. You can check out the full post for more details, but here are some easy things to remember about modules: Modules can be scripts with functions, scripts that include [&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":[94,178,4,216],"class_list":["post-5631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-add-module","tag-get-module","tag-howto","tag-module"],"acf":[],"blog_post_summary":"<p>One of the coolest new features of Windows PowerShell is PowerShell modules.&#160; I&#8217;ve just written a tutorial about how to use them on my personal blog. You can check out the full post for more details, but here are some easy things to remember about modules: Modules can be scripts with functions, scripts that include [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/5631","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=5631"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/5631\/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=5631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=5631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=5631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}