Cmdlets are specialized commands in a Windows PowerShell script that perform a single function. A cmdlet is typically expressed as a verb-noun pair. The result returned by a cmdlet is an object.
You can pipeline PowerShell commands, which enables the output of one cmdlet to be piped as input to another cmdlet. As a simple example, you can request the list of commands in the Rapid Recovery PowerShell module, and sort that list by name. The example script for this is:
Get-Command -module rapidrecoverypowershellmodule | sort-object name
Getting cmdlet help and examples
After you open PowerShell and import the Rapid Recovery PowerShell module, you can request additional information at any time by using the Get-Help <command_name> cmdlet. For example, to get information about the virtual machine export cmdlet, enter the following cmdlet and then press Enter:
Get-Help Start-VMExport
The object returned includes the command name, synopsis, syntax, and any options you can use with the command.
Another method to get help for a specific cmdlet is to type the command name followed by -?
. For example:
Start-VMExport -?
You can also request examples for a cmdlet by executing the following command:
>Get-Help Start-VMExport -examples
This section describes the cmdlets and options available in the Rapid Recovery PowerShell Module. All cmdlets in the Rapid Recovery PowerShell Module support the following common parameters:
- Verbose
- Debug
- ErrorAction
- ErrorVariable
- WarningAction
- WarningVariable
- OutBuffer
- OutVariable
For more information, use Get-Help about_commonparameters
.
The Add-EsxAutoProtectObjects
cmdlet enables auto protection for specified objects on a vCenter or ESXi server.
Usage
The usage for the command is as follows:
Add-EsxAutoProtectObjects -core [host name] -user [user name] -password [password] -repository [name] -protectedserver [name | IP address] -autoprotect [object name collection]
Command Options
The following table describes the options available for the Add-EsxAutoProtectObjects
command:
Table 77: Add-EsxAutoProtectObjects command options
-? |
Display this help message. |
-core |
Optional. Remote Core host machine IP address (with an optional port number). By default the connection is made to the Core installed on the local machine. |
-user |
Optional. User name for the remote Core host machine. If you specify a user name, you also have to provide a password.
If none are provided, then the logged-on user's credentials will be used. |
-password |
Optional. Password to the remote Core host machine. If you specify a password, you also have to provide a log on.
If none are provided, then the logged-on user's credentials will be used. |
-repository |
Required. The name of the repository that is associated with the Core that you want to use to protect the virtual machine.
Note: You must enclose the name in double quotes. |
-protectedserver |
Show jobs for a specific protected machine, indicated by IP address. |
-autoprotect |
Optional. This option lets you list the new virtual machines that you want to automatically protect. |
Example:
Put specific objects from a vCenter or ESXi server under auto-protection by the Core:
>Add-EsxAutoProtectObjects -protectedserver 10.10.8.150 -add -autoprotect "Folder1", "Folder2"
The Add-EsxVirtualMachines
cmdlet lets you add specific virtual machines (VMs) on vCenter or ESXi server under the protection of a Core.
Usage
The usage for the command is as follows:
Add-EsxVirtualMachines -core [host name] -user [user name] -password [password] -repository [name] -protectedserver [name | IP address] -virtualmachines [virtual machines collection | all]
Command Options
The following table describes the options available for the Add-EsxVirtualMachines
command:
Table 78: Add-EsxVirtualMachines command options
-? |
Display this help message. |
-core |
Optional. Remote Core host machine IP address (with an optional port number). By default the connection is made to the Core installed on the local machine. |
-user |
Optional. User name for the remote Core host machine. If you specify a user name, you also have to provide a password.
If none are provided, then the logged-on user's credentials will be used. |
-password |
Optional. Password to the remote Core host machine. If you specify a password, you also have to provide a log on.
If none are provided, then the logged-on user's credentials will be used. |
-repository |
Required. The name of the repository that is associated with the Core that you want to use to store the data of the virtual machine.
NOTE: You must enclose the name in double quotes. |
-protectedserver |
Use this option to edit the vCenter or ESXi objects for a specific protected machine. |
-virtualmachines |
A list of virtual machines each separate by a comma. |
Example:
Add two VMs from a vCenter or ESXi server under protection by the Core:
>Add-EsxVirtualMachines -repository "repository1" -protectedserver 10.10.10.10 -virtualmachines "vm1", "vm2"