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 info? Modules exist for that.
- Need to create a Veeam backup job? Just install the module.
- Need to make changes to Linux? Powershell has an SSH module.
- WSUS? Module.
What commands are there that relate to modules?
Simple, just issue the following command:
Get-Command *module*
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.
So, what modules are out there?
Just issue the command:
Find-Module
You will get a huge list of publicly downloadable modules, which is too long to list here!
Let’s focus on something specific instead.
To see if there are any Zerto modules for Powershell, issue the command:
Find-Module *Zerto*
There are 3 Zerto modules for Powershell – (bear in mind this could change in the future).
How do I install a Zerto module?
To install the ZertoModule module, issue the command install-module ZertoModule in an elevated Powershell window.
install-module ZertoModule
How do I know what the new commands are?
Issue the command?
get-command -module ZertoModule
How do I know which modules are installed?
To see the modules installed, issue the command?
Get-InstalledModule
Looking at the list there are VMWare, FreeNAS, SSH and SNMP modules installed.
But installed modules do not mean enabled modules.
Just because a module is installed does not mean it is loaded and ready to use.
To use a module you need to import it. So, to enable and use the FreeNAS module issue the command?
Import-Module FreeNAS
So, that is the basics of finding, installing and importing modules. You really can find a Powershell module to do almost anything out there.