{"id":171,"date":"2019-11-19T20:41:23","date_gmt":"2019-11-19T20:41:23","guid":{"rendered":"http:\/\/192.168.8.14\/?p=171"},"modified":"2019-11-19T20:41:23","modified_gmt":"2019-11-19T20:41:23","slug":"powershell-tutorial-modules","status":"publish","type":"post","link":"https:\/\/www.jasonstreet.com\/?p=171","title":{"rendered":"Powershell tutorial, Modules"},"content":{"rendered":"\n<p>In this post I will explain using and managing Powershell modules.<\/p>\n\n\n\n<p>A Powershell module is simply a piece of code which adds more commands to the Powershell compiler to expand its cross platform functionality.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Need to get info out of VMWare? No problem, there are several modules for that.<\/li><li>Need to get SNMP info? Modules exist for that.<\/li><li>Need to create a Veeam backup job? Just install the module.<\/li><li>Need to make changes to Linux? Powershell has an SSH module.<\/li><li>WSUS? Module.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">What commands are there that relate to modules?<\/h3>\n\n\n\n<p>Simple, just issue the following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-Command *module*\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"495\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/Module001.png\" alt=\"\" class=\"wp-image-172\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/Module001.png 799w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/Module001-300x186.png 300w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/Module001-768x476.png 768w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<p>In this post I am only telling you about finding and installing modules. But you can also create your own, using some of the other commands above.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">So, what modules are out there?<\/h3>\n\n\n\n<p>Just issue the command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nFind-Module\n<\/pre><\/div>\n\n\n<p>You will get a huge list of publicly downloadable modules, which is too long to list here!<\/p>\n\n\n\n<p>Let\u2019s focus on something specific instead.<br>To see if there are any Zerto modules for Powershell, issue the command<a href=\"http:\/\/192.168.8.14\/?p=157#\">:<\/a><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nFind-Module *Zerto*\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"838\" height=\"106\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/module002.png\" alt=\"\" class=\"wp-image-173\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module002.png 838w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module002-300x38.png 300w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module002-768x97.png 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<p>There are 3 Zerto modules for Powershell \u2013 (bear in mind this could change in the future).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I install a Zerto module?<\/h3>\n\n\n\n<p>To install the ZertoModule module, issue the command&nbsp;<strong>install-module ZertoModule<\/strong>&nbsp;in an elevated Powershell window.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\ninstall-module ZertoModule\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"126\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/module003.png\" alt=\"\" class=\"wp-image-174\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module003.png 814w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module003-300x46.png 300w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module003-768x119.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">How do I know what the new commands are?<\/h3>\n\n\n\n<p>Issue the command<a href=\"http:\/\/192.168.8.14\/?p=157#\">?<\/a><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nget-command -module ZertoModule\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"269\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/module004.png\" alt=\"\" class=\"wp-image-175\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module004.png 680w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module004-300x119.png 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">How do I know which modules are installed?<\/h3>\n\n\n\n<p>To see the modules installed, issue the command<a href=\"http:\/\/192.168.8.14\/?p=157#\">?<\/a><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nGet-InstalledModule\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"412\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/module005.png\" alt=\"\" class=\"wp-image-176\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module005.png 837w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module005-300x148.png 300w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module005-768x378.png 768w\" sizes=\"auto, (max-width: 837px) 100vw, 837px\" \/><\/figure>\n\n\n\n<p>Looking at the list there are VMWare, FreeNAS, SSH and SNMP modules installed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">But installed modules do not mean enabled modules.<\/h3>\n\n\n\n<p>Just because a module is installed does not mean it is loaded and ready to use.<\/p>\n\n\n\n<p>To use a module you need to import it. So, to enable and use the FreeNAS module issue the command<a href=\"http:\/\/192.168.8.14\/?p=157#\">?<\/a><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nImport-Module FreeNAS\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"842\" height=\"222\" src=\"http:\/\/192.168.8.14\/wp-content\/uploads\/2019\/11\/module006.png\" alt=\"\" class=\"wp-image-177\" srcset=\"https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module006.png 842w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module006-300x79.png 300w, https:\/\/www.jasonstreet.com\/wp-content\/uploads\/2019\/11\/module006-768x202.png 768w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/figure>\n\n\n\n<p>\n\nSo, that is the basics of finding, installing and importing modules. You really can find a Powershell module to do almost anything out there.\n\n<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I will explain using and managing Powershell modules. A Powershell module is simply a piece of code which adds more commands to the Powershell compiler to expand its cross platform functionality. For example: Need to get info out of VMWare? No problem, there are several modules for that. Need to get SNMP&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,27],"tags":[31],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-powershell","category-tutorial","tag-modules"],"_links":{"self":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171"}],"version-history":[{"count":1,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":178,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions\/178"}],"wp:attachment":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}