Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Getting Stated with Zerto Virtual Manager
This module can be installed directly from the PowerShell Gallery with the following command.
PS> Install-Module -name ZertoApiWrapper
Now when ever you use a ZertoApiWrapper command, the module will automatically load.
Connecting to a Zerto Virtal Manager
Before any of the functions will work, you will need to connect to a Zerto Virtual Manager server. To do this you will use the
Connect-ZertoServer function passing in a Server Name or IP address of the Zerto Virtual Manager. If you are using a non-standard port, you will need to provide that as well with the
-zertoPort parameter. You will also need to supply credentials to authenticate against the Zerto Virtual Manager. If credentials are not provided, the user will be prompted for a username and password.
PS C:\>$credential = Get-Credential PS C:\>Connect-ZertoServer -zertoServer "192.168.222.20" -credential $credential
After successful execution, a few Module level variables are set that are not currently exposed. These variables keep track of the Zerto Server connection information such as Server Name and Port information along with the authentication headers. A "Last Action" variable is also set to keep track of when the last call was made to the API to determine if the authentication information has expired or not. Should this command be run again with a different server, the old information will be overwritten and all commands from that point will be executed against the new server information.
Using the Module
A help system is currently under development. While each command has a help page, it may not be fully fleshed out yet. To see all possible functions you can use the following command after the module has been imported:
PS C:\>Get-Command -module ZertoApiWrapper
Once you have found the command that you want to know about you can call
Get-Help <Command> to take a look at the help page, or if you want to see syntax,
Get-Command <Command> -syntax.
Ending the Session
If you are using this as part of a larger script, I highly suggest explicitly ending your session with the
Disconnect-ZertoSession command. This will delete the token authorization from the Zerto Virtual Manager as well as clear all Module scoped variables.