Update mandatory parameter declaration

This commit is contained in:
Wes Carroll
2020-05-05 21:59:14 -04:00
parent aecd4fd1d5
commit e6ead11891
40 changed files with 167 additions and 167 deletions
@@ -3,7 +3,7 @@ function Get-ZertoApiFilter {
[Outputtype([String])] [Outputtype([String])]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Hashtable that contains filter keys and values" HelpMessage = "Hashtable that contains filter keys and values"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
+1 -1
View File
@@ -3,7 +3,7 @@ function Add-ZertoPeerSite {
[cmdletbinding( SupportsShouldProcess = $true )] [cmdletbinding( SupportsShouldProcess = $true )]
param( param(
[parameter( [parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Target Hostname or IP address to pair the localsite to." HelpMessage = "Target Hostname or IP address to pair the localsite to."
)] )]
[ValidateScript( { $_ -match [IPAddress]$_ } )] [ValidateScript( { $_ -match [IPAddress]$_ } )]
@@ -3,7 +3,7 @@ function Checkpoint-ZertoVpg {
[cmdletbinding()] [cmdletbinding()]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Name of the VPG to tag.", HelpMessage = "Name of the VPG to tag.",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true ValueFromPipelineByPropertyName = $true
@@ -11,7 +11,7 @@ function Checkpoint-ZertoVpg {
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Text to tag the checkpoint with." HelpMessage = "Text to tag the checkpoint with."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -27,10 +27,10 @@ function Checkpoint-ZertoVpg {
$vpgIdentifier = $(get-zertovpg -name $name).vpgIdentifier $vpgIdentifier = $(get-zertovpg -name $name).vpgIdentifier
if ($vpgIdentifier) { if ($vpgIdentifier) {
$uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier $uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier
$body = @{"checkpointName" = $checkpointName} $body = @{"checkpointName" = $checkpointName }
Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST"
} else { } else {
Write-Output "Cannot find VPG named $name. Please check the name and try again." Write-Output "Cannot find VPG named $name. Please check the name and try again."
} }
} }
} }
@@ -3,7 +3,7 @@ function Connect-ZertoAnalytics {
[cmdletbinding()] [cmdletbinding()]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site",
Position = 0 Position = 0
)] )]
@@ -4,7 +4,7 @@ function Connect-ZertoServer {
[OutputType([hashtable])] [OutputType([hashtable])]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "IP address or FQDN of your Zerto Management Server" HelpMessage = "IP address or FQDN of your Zerto Management Server"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -18,7 +18,7 @@ function Connect-ZertoServer {
[Alias("port")] [Alias("port")]
[string]$zertoPort = "9669", [string]$zertoPort = "9669",
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Valid credentials to connect to the Zerto Management Server" HelpMessage = "Valid credentials to connect to the Zerto Management Server"
)] )]
[System.Management.Automation.PSCredential]$credential, [System.Management.Automation.PSCredential]$credential,
+1 -1
View File
@@ -3,7 +3,7 @@ function Edit-ZertoVra {
[cmdletbinding( SupportsShouldProcess = $true )] [cmdletbinding( SupportsShouldProcess = $true )]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Identifier of the VRA to be updated." HelpMessage = "Identifier of the VRA to be updated."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
+3 -3
View File
@@ -4,7 +4,7 @@ function Export-ZertoVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Location where to dump the resulting JSON files containing the VPG Settings", HelpMessage = "Location where to dump the resulting JSON files containing the VPG Settings",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[Alias("outputFolder")] [Alias("outputFolder")]
@@ -12,7 +12,7 @@ function Export-ZertoVpg {
[parameter( [parameter(
HelpMessage = "Name(s) of the VPG(s) to be exported", HelpMessage = "Name(s) of the VPG(s) to be exported",
ParameterSetName = "namedVpgs", ParameterSetName = "namedVpgs",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
@@ -21,7 +21,7 @@ function Export-ZertoVpg {
ParameterSetName = "allVpgs", ParameterSetName = "allVpgs",
valuefrompipeline = $true, valuefrompipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
Mandatory = $true Mandatory
)] )]
[switch]$allVpgs [switch]$allVpgs
) )
+1 -1
View File
@@ -17,7 +17,7 @@ function Get-ZAAlert {
[Parameter( [Parameter(
HelpMessage = "The alert Idnetifier", HelpMessage = "The alert Idnetifier",
ParameterSetName = "alertId", ParameterSetName = "alertId",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$alertIdentifier [string]$alertIdentifier
+5 -5
View File
@@ -4,15 +4,15 @@ function Get-ZADatastore {
param ( param (
[Parameter( [Parameter(
HelpMessage = "The site identifier. The site identifier is mandatory. Omit the datastore and datastore cluster identifiers to view site level storage information.", HelpMessage = "The site identifier. The site identifier is mandatory. Omit the datastore and datastore cluster identifiers to view site level storage information.",
Mandatory = $true, Mandatory,
ParameterSetName = "AllInfo" ParameterSetName = "AllInfo"
)] )]
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
ParameterSetName = "cluster" ParameterSetName = "cluster"
)] )]
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
ParameterSetName = "datastore" ParameterSetName = "datastore"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -20,14 +20,14 @@ function Get-ZADatastore {
[Parameter( [Parameter(
HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.", HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.",
ParameterSetName = "cluster", ParameterSetName = "cluster",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$clusterIdentifier, [string]$clusterIdentifier,
[Parameter( [Parameter(
HelpMessage = "The datastore identifer. Gets the datastore info.", HelpMessage = "The datastore identifer. Gets the datastore info.",
ParameterSetName = "datastore", ParameterSetName = "datastore",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$datastoreIdentifier [string]$datastoreIdentifier
+1 -1
View File
@@ -17,7 +17,7 @@ function Get-ZATask {
[Parameter( [Parameter(
HelpMessage = "The task Idnetifier", HelpMessage = "The task Idnetifier",
ParameterSetName = "taskId", ParameterSetName = "taskId",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$taskIdentifier [string]$taskIdentifier
+1 -1
View File
@@ -11,7 +11,7 @@ function Get-ZAVpg {
[Parameter( [Parameter(
HelpMessage = "The VPG Identifier", HelpMessage = "The VPG Identifier",
ParameterSetName = "vpg", ParameterSetName = "vpg",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$vpgIdentifier [string]$vpgIdentifier
+4 -4
View File
@@ -4,7 +4,7 @@ function Get-ZertoAlert {
param( param(
[Parameter( [Parameter(
ParameterSetName = "alertId", ParameterSetName = "alertId",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true , ValueFromPipelineByPropertyName = $true ,
HelpMessage = "AlertId or array of AlertIds to be queried" HelpMessage = "AlertId or array of AlertIds to be queried"
@@ -13,19 +13,19 @@ function Get-ZertoAlert {
[string[]]$alertId, [string[]]$alertId,
[Parameter( [Parameter(
ParameterSetName = "entities", ParameterSetName = "entities",
Mandatory = $true, Mandatory,
HelpMessage = "Switch to return the entities information from the API" HelpMessage = "Switch to return the entities information from the API"
)] )]
[switch]$entities, [switch]$entities,
[Parameter( [Parameter(
ParameterSetName = "helpIdentifiers", ParameterSetName = "helpIdentifiers",
Mandatory = $true, Mandatory,
HelpMessage = "Switch to get the Help Identifiers information from the API" HelpMessage = "Switch to get the Help Identifiers information from the API"
)] )]
[switch]$helpIdentifiers, [switch]$helpIdentifiers,
[Parameter( [Parameter(
ParameterSetName = "levels", ParameterSetName = "levels",
Mandatory = $true, Mandatory,
HelpMessage = "Switch to return Alert Levels information from the API" HelpMessage = "Switch to return Alert Levels information from the API"
)] )]
[switch]$levels, [switch]$levels,
+4 -4
View File
@@ -86,7 +86,7 @@ function Get-ZertoEvent {
[string]$alertIdentifier, [string]$alertIdentifier,
[Parameter( [Parameter(
ParameterSetName = "eventId", ParameterSetName = "eventId",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
HelpMessage = "The identifier or identifiers of the event for which information is returned." HelpMessage = "The identifier or identifiers of the event for which information is returned."
@@ -95,19 +95,19 @@ function Get-ZertoEvent {
[string[]]$eventId, [string[]]$eventId,
[Parameter( [Parameter(
ParameterSetName = "categories", ParameterSetName = "categories",
Mandatory = $true, Mandatory,
HelpMessage = "Returns possible Event Categories." HelpMessage = "Returns possible Event Categories."
)] )]
[switch]$categories, [switch]$categories,
[Parameter( [Parameter(
ParameterSetName = "entities", ParameterSetName = "entities",
Mandatory = $true, Mandatory,
HelpMessage = "Returns possible entity types." HelpMessage = "Returns possible entity types."
)] )]
[switch]$entities, [switch]$entities,
[Parameter( [Parameter(
ParameterSetName = "types", ParameterSetName = "types",
Mandatory = $true, Mandatory,
HelpMessage = "Returns possible event types.")] HelpMessage = "Returns possible event types.")]
[switch]$types [switch]$types
) )
+2 -2
View File
@@ -5,12 +5,12 @@ function Get-ZertoPeerSite {
[Parameter( [Parameter(
ParameterSetName = "pairingStatuses", ParameterSetName = "pairingStatuses",
HelpMessage = "Switch to return possible paiting statuses.", HelpMessage = "Switch to return possible paiting statuses.",
Mandatory = $true Mandatory
)] )]
[switch]$pairingStatuses, [switch]$pairingStatuses,
[Parameter( [Parameter(
ParameterSetName = "siteIdentifier", ParameterSetName = "siteIdentifier",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
HelpMessage = "The identifier(s) of the peer site(s) for which information is to be returned." HelpMessage = "The identifier(s) of the peer site(s) for which information is to be returned."
@@ -4,7 +4,7 @@ function Get-ZertoProtectedVm {
param ( param (
[Parameter( [Parameter(
ParameterSetName = "vmIdentifier", ParameterSetName = "vmIdentifier",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
HelpMessage = "vmIdentifier(s) for which to return information" HelpMessage = "vmIdentifier(s) for which to return information"
@@ -4,57 +4,57 @@ function Get-ZertoVirtualizationSite {
param( param(
[Parameter( [Parameter(
ParameterSetName = "siteIdentifier", ParameterSetName = "siteIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "datastoreClusters", ParameterSetName = "datastoreClusters",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "datastores", ParameterSetName = "datastores",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "hostClusters", ParameterSetName = "hostClusters",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "hosts", ParameterSetName = "hosts",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "networks", ParameterSetName = "networks",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "resourcePools", ParameterSetName = "resourcePools",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "vms", ParameterSetName = "vms",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "devices", ParameterSetName = "devices",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "folders", ParameterSetName = "folders",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[Parameter( [Parameter(
ParameterSetName = "repositories", ParameterSetName = "repositories",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -62,19 +62,19 @@ function Get-ZertoVirtualizationSite {
[string]$siteIdentifier, [string]$siteIdentifier,
[Parameter( [Parameter(
ParameterSetName = "datastoreClusters", ParameterSetName = "datastoreClusters",
Mandatory = $true, Mandatory,
HelpMessage = "When selected, will return all datastore clusters at the specified site." HelpMessage = "When selected, will return all datastore clusters at the specified site."
)] )]
[switch]$datastoreClusters, [switch]$datastoreClusters,
[Parameter( [Parameter(
ParameterSetName = "datastores", ParameterSetName = "datastores",
Mandatory = $true, Mandatory,
HelpMessage = "When selected, will return all datastores at the specified site." HelpMessage = "When selected, will return all datastores at the specified site."
)] )]
[switch]$datastores, [switch]$datastores,
[Parameter( [Parameter(
ParameterSetName = "devices", ParameterSetName = "devices",
Mandatory = $true, Mandatory,
HelpMessage = "When selected, will return all devices at the specified site." HelpMessage = "When selected, will return all devices at the specified site."
)] )]
[switch]$devices, [switch]$devices,
@@ -93,43 +93,43 @@ function Get-ZertoVirtualizationSite {
[string]$hostIdentifier, [string]$hostIdentifier,
[Parameter( [Parameter(
ParameterSetName = "folders", ParameterSetName = "folders",
Mandatory = $true, Mandatory,
HelpMessage = "Return all folders at the selected site." HelpMessage = "Return all folders at the selected site."
)] )]
[switch]$folders, [switch]$folders,
[Parameter( [Parameter(
ParameterSetName = "hostClusters", ParameterSetName = "hostClusters",
Mandatory = $true, Mandatory,
HelpMessage = "Return all host clusters at the selected site." HelpMessage = "Return all host clusters at the selected site."
)] )]
[switch]$hostClusters, [switch]$hostClusters,
[Parameter( [Parameter(
ParameterSetName = "hosts", ParameterSetName = "hosts",
Mandatory = $true, Mandatory,
HelpMessage = "Return all hosts at the selected site. If a host identifier is provided, return only that host." HelpMessage = "Return all hosts at the selected site. If a host identifier is provided, return only that host."
)] )]
[switch]$hosts, [switch]$hosts,
[Parameter( [Parameter(
ParameterSetName = "networks", ParameterSetName = "networks",
Mandatory = $true, Mandatory,
HelpMessage = "Return all networks at the selected site." HelpMessage = "Return all networks at the selected site."
)] )]
[switch]$networks, [switch]$networks,
[Parameter( [Parameter(
ParameterSetName = "resourcePools", ParameterSetName = "resourcePools",
Mandatory = $true, Mandatory,
HelpMessage = "Return all resource pools at the selected site." HelpMessage = "Return all resource pools at the selected site."
)] )]
[switch]$resourcePools, [switch]$resourcePools,
[Parameter( [Parameter(
ParameterSetName = "vms", ParameterSetName = "vms",
Mandatory = $true, Mandatory,
HelpMessage = "Return all VMs at the selected site." HelpMessage = "Return all VMs at the selected site."
)] )]
[switch]$vms, [switch]$vms,
[Parameter( [Parameter(
ParameterSetName = "repositories", ParameterSetName = "repositories",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the Zerto Virtual Manager site." HelpMessage = "The identifier of the Zerto Virtual Manager site."
)] )]
[switch]$repositories [switch]$repositories
+12 -12
View File
@@ -4,17 +4,17 @@ function Get-ZertoVpg {
param( param(
[Parameter( [Parameter(
ParameterSetName = "protectionGroupIdentifier", ParameterSetName = "protectionGroupIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier(s) of the Virtual Protection Group to return" HelpMessage = "The identifier(s) of the Virtual Protection Group to return"
)] )]
[Parameter( [Parameter(
ParameterSetName = "checkpoints", ParameterSetName = "checkpoints",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier(s) of the Virtual Protection Group to return" HelpMessage = "The identifier(s) of the Virtual Protection Group to return"
)] )]
[Parameter( [Parameter(
ParameterSetName = "stats", ParameterSetName = "stats",
Mandatory = $true, Mandatory,
HelpMessage = "The identifier(s) of the Virtual Protection Group to return" HelpMessage = "The identifier(s) of the Virtual Protection Group to return"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -22,7 +22,7 @@ function Get-ZertoVpg {
[string[]]$protectionGroupIdentifier, [string[]]$protectionGroupIdentifier,
[Parameter( [Parameter(
ParameterSetName = "checkpoints", ParameterSetName = "checkpoints",
Mandatory = $true, Mandatory,
HelpMessage = "Return checkpoints for the selected Virtual Protection Group." HelpMessage = "Return checkpoints for the selected Virtual Protection Group."
)] )]
[switch]$checkpoints, [switch]$checkpoints,
@@ -39,49 +39,49 @@ function Get-ZertoVpg {
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$endDate, [string]$endDate,
[Parameter( [Parameter(
ParameterSetName = "stats", Mandatory = $true, ParameterSetName = "stats", Mandatory,
HelpMessage = "Return earliest and latest checkpoints for the selected Virtual Protection Group" HelpMessage = "Return earliest and latest checkpoints for the selected Virtual Protection Group"
)] )]
[switch]$checkpointsStats, [switch]$checkpointsStats,
[Parameter( [Parameter(
ParameterSetName = "entityTypes", ParameterSetName = "entityTypes",
Mandatory = $true, Mandatory,
HelpMessage = "Return Valid VPG entityTypes" HelpMessage = "Return Valid VPG entityTypes"
)] )]
[switch]$entityTypes, [switch]$entityTypes,
[Parameter( [Parameter(
ParameterSetName = "failoverCommitPolicies", ParameterSetName = "failoverCommitPolicies",
Mandatory = $true, Mandatory,
HelpMessage = "Valid Failover Commit Policies" HelpMessage = "Valid Failover Commit Policies"
)] )]
[switch]$failoverCommitPolicies, [switch]$failoverCommitPolicies,
[Parameter( [Parameter(
ParameterSetName = "failoverShutdownPolicies", ParameterSetName = "failoverShutdownPolicies",
Mandatory = $true, Mandatory,
HelpMessage = "Valid Failover Shutdown Policies" HelpMessage = "Valid Failover Shutdown Policies"
)] )]
[switch]$failoverShutdownPolicies, [switch]$failoverShutdownPolicies,
[Parameter( [Parameter(
ParameterSetName = "priorities", ParameterSetName = "priorities",
Mandatory = $true, Mandatory,
HelpMessage = "Valid VPG priorities" HelpMessage = "Valid VPG priorities"
)] )]
[switch]$priorities, [switch]$priorities,
[Parameter( [Parameter(
ParameterSetName = "retentionPolicies", ParameterSetName = "retentionPolicies",
Mandatory = $true, Mandatory,
HelpMessage = "Valid retention policies" HelpMessage = "Valid retention policies"
)] )]
[switch]$retentionPolicies, [switch]$retentionPolicies,
[Parameter( [Parameter(
ParameterSetName = "statuses", ParameterSetName = "statuses",
Mandatory = $true, Mandatory,
HelpMessage = "Valid VPG statuses" HelpMessage = "Valid VPG statuses"
)] )]
[switch]$statuses, [switch]$statuses,
[Parameter( [Parameter(
ParameterSetName = "subStatuses", ParameterSetName = "subStatuses",
Mandatory = $true, Mandatory,
HelpMessage = "Valid VPG sub statuses" HelpMessage = "Valid VPG sub statuses"
)] )]
[switch]$subStatuses, [switch]$subStatuses,
+41 -41
View File
@@ -10,7 +10,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -18,7 +18,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." HelpMessage = "The identifier of the VPG settings object for which information is retrieved. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error."
)] )]
[Parameter( [Parameter(
@@ -26,7 +26,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -34,7 +34,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -42,7 +42,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -50,7 +50,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -58,7 +58,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -66,7 +66,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -74,7 +74,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -82,7 +82,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -90,7 +90,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -98,7 +98,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -106,7 +106,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -114,7 +114,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -122,7 +122,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -130,7 +130,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -138,7 +138,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -146,7 +146,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[Parameter( [Parameter(
@@ -154,7 +154,7 @@ function Get-ZertoVpgSetting {
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $true, ValueFromRemainingArguments = $true,
Mandatory = $true, Mandatory,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved." HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -162,100 +162,100 @@ function Get-ZertoVpgSetting {
[string[]]$vpgSettingsIdentifier, [string[]]$vpgSettingsIdentifier,
[Parameter( [Parameter(
ParameterSetName = "backup", ParameterSetName = "backup",
Mandatory = $true, Mandatory,
HelpMessage = "Return backup information for VPG identifier specified. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." HelpMessage = "Return backup information for VPG identifier specified. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error."
)] )]
[switch]$backup, [switch]$backup,
[Parameter( [Parameter(
ParameterSetName = "dayOfWeek", ParameterSetName = "dayOfWeek",
Mandatory = $true, Mandatory,
HelpMessage = "Get the day of week a backup is scheduled. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." HelpMessage = "Get the day of week a backup is scheduled. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error."
)] )]
[switch]$dayOfWeek, [switch]$dayOfWeek,
[Parameter( [Parameter(
ParameterSetName = "retentionPeriod", ParameterSetName = "retentionPeriod",
Mandatory = $true, Mandatory,
HelpMessage = "Get the retention period for a backup. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." HelpMessage = "Get the retention period for a backup. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error."
)] )]
[switch]$retentionPeriod, [switch]$retentionPeriod,
[Parameter( [Parameter(
ParameterSetName = "schedulerPeriod", ParameterSetName = "schedulerPeriod",
Mandatory = $true, Mandatory,
HelpMessage = "Get the backup schedule. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." HelpMessage = "Get the backup schedule. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error."
)] )]
[switch]$schedulerPeriod, [switch]$schedulerPeriod,
[Parameter( [Parameter(
ParameterSetName = "basic", ParameterSetName = "basic",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Basic Settings" HelpMessage = "Get VPG Basic Settings"
)] )]
[switch]$basic, [switch]$basic,
[Parameter( [Parameter(
ParameterSetName = "bootGroup", ParameterSetName = "bootGroup",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Boot Settings" HelpMessage = "Get VPG Boot Settings"
)] )]
[switch]$bootgroup, [switch]$bootgroup,
[Parameter( [Parameter(
ParameterSetName = "journal", ParameterSetName = "journal",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Journal Settings" HelpMessage = "Get VPG Journal Settings"
)] )]
[switch]$journal, [switch]$journal,
[Parameter( [Parameter(
ParameterSetName = "networks", ParameterSetName = "networks",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Network Settings" HelpMessage = "Get VPG Network Settings"
)] )]
[switch]$networks, [switch]$networks,
[Parameter( [Parameter(
ParameterSetName = "priority", ParameterSetName = "priority",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Priority Settings" HelpMessage = "Get VPG Priority Settings"
)] )]
[switch]$priority, [switch]$priority,
[Parameter( [Parameter(
ParameterSetName = "recovery", ParameterSetName = "recovery",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Recovery Settings" HelpMessage = "Get VPG Recovery Settings"
)] )]
[Alias("rcovery")] [Alias("rcovery")]
[switch]$recovery, [switch]$recovery,
[Parameter( [Parameter(
ParameterSetName = "scripting", ParameterSetName = "scripting",
Mandatory = $true, Mandatory,
HelpMessage = "Get VPG Recovery Settings" HelpMessage = "Get VPG Recovery Settings"
)] )]
[switch]$scripting, [switch]$scripting,
[Parameter( [Parameter(
ParameterSetName = "vms", ParameterSetName = "vms",
Mandatory = $true, Mandatory,
HelpMessage = "Get all settings for all VMs in a VPG." HelpMessage = "Get all settings for all VMs in a VPG."
)] )]
[switch]$vms, [switch]$vms,
[Parameter( [Parameter(
ParameterSetName = "vmIdentifier", ParameterSetName = "vmIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "Get all settings for selected VM" HelpMessage = "Get all settings for selected VM"
)] )]
[Parameter( [Parameter(
ParameterSetName = "nics", ParameterSetName = "nics",
Mandatory = $true, Mandatory,
HelpMessage = "VM Identifier" HelpMessage = "VM Identifier"
)] )]
[Parameter( [Parameter(
ParameterSetName = "volumes", ParameterSetName = "volumes",
Mandatory = $true, Mandatory,
HelpMessage = "VM Identifier" HelpMessage = "VM Identifier"
)] )]
[Parameter( [Parameter(
ParameterSetName = "nicIdentifier", ParameterSetName = "nicIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "VM Identifier" HelpMessage = "VM Identifier"
)] )]
[Parameter( [Parameter(
ParameterSetName = "volumeIdentifier", ParameterSetName = "volumeIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "VM Identifier" HelpMessage = "VM Identifier"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -263,13 +263,13 @@ function Get-ZertoVpgSetting {
[string]$vmIdentifier, [string]$vmIdentifier,
[Parameter( [Parameter(
ParameterSetName = "nics", ParameterSetName = "nics",
Mandatory = $true, Mandatory,
HelpMessage = "Return NIC information for all NICs of the specified VM" HelpMessage = "Return NIC information for all NICs of the specified VM"
)] )]
[switch]$nics, [switch]$nics,
[Parameter( [Parameter(
ParameterSetName = "nicIdentifier", ParameterSetName = "nicIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "Return NIC information for specified NIC of the specified VM" HelpMessage = "Return NIC information for specified NIC of the specified VM"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -277,13 +277,13 @@ function Get-ZertoVpgSetting {
[string]$nicIdentifier, [string]$nicIdentifier,
[Parameter( [Parameter(
ParameterSetName = "volumes", ParameterSetName = "volumes",
Mandatory = $true, Mandatory,
HelpMessage = "Return Volume information for all volumes of the specified VM" HelpMessage = "Return Volume information for all volumes of the specified VM"
)] )]
[switch]$volumes, [switch]$volumes,
[Parameter( [Parameter(
ParameterSetName = "volumeIdentifier", ParameterSetName = "volumeIdentifier",
Mandatory = $true, Mandatory,
HelpMessage = "Return volume information for the specified volume of the specified VM" HelpMessage = "Return volume information for the specified volume of the specified VM"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -291,7 +291,7 @@ function Get-ZertoVpgSetting {
[string]$volumeIdentifier, [string]$volumeIdentifier,
[Parameter( [Parameter(
ParameterSetName = "ltr", ParameterSetName = "ltr",
Mandatory = $true, Mandatory,
HelpMessage = "Return LTR information for the specified VPG. Please note, this parameter is ONLY available in Zerto version 8.0 and later. Attempting to run this switch against a Zerto Virtual Manager version 7.5 or lower will result in an error." HelpMessage = "Return LTR information for the specified VPG. Please note, this parameter is ONLY available in Zerto version 8.0 and later. Attempting to run this switch against a Zerto Virtual Manager version 7.5 or lower will result in an error."
)] )]
[switch]$ltr [switch]$ltr
+1 -1
View File
@@ -4,7 +4,7 @@ function Import-ZertoVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "VPG settings JSON file(s) to import.", HelpMessage = "VPG settings JSON file(s) to import.",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true ValueFromPipelineByPropertyName = $true
)] )]
@@ -4,7 +4,7 @@ function Invoke-ZertoFailover {
param( param(
#TODO - Refactor? #TODO - Refactor?
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Name of the VPG to Failover" HelpMessage = "Name of the VPG to Failover"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -54,7 +54,7 @@ function Invoke-ZertoFailover {
Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop
} }
$baseUri = "vpgs/{0}/failover" -f $vpgId $baseUri = "vpgs/{0}/failover" -f $vpgId
$body = @{} $body = @{ }
# Setup Required Defaults # Setup Required Defaults
$body['commitpolicy'] = $commitPolicy $body['commitpolicy'] = $commitPolicy
$body['TimeToWaitBeforeShutdownInSec'] = $timeToWaitBeforeShutdownInSec $body['TimeToWaitBeforeShutdownInSec'] = $timeToWaitBeforeShutdownInSec
@@ -76,7 +76,7 @@ function Invoke-ZertoFailover {
$vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName $vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName
[System.Collections.ArrayList]$vmIdentifiers = @() [System.Collections.ArrayList]$vmIdentifiers = @()
foreach ( $name in $vmName ) { foreach ( $name in $vmName ) {
$selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()} $selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() }
if ($null -eq $selectedVm) { if ($null -eq $selectedVm) {
Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop
} elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) { } elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) {
@@ -4,7 +4,7 @@ function Invoke-ZertoFailoverCommit {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of the VPG(s) to commit.", HelpMessage = "Name(s) of the VPG(s) to commit.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
@@ -4,7 +4,7 @@ function Invoke-ZertoFailoverRollback {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to roll back from failing over", HelpMessage = "Name(s) of VPG(s) to roll back from failing over",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName [string[]]$vpgName
@@ -4,7 +4,7 @@ function Invoke-ZertoForceSync {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to force sync", HelpMessage = "Name(s) of VPG(s) to force sync",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName [string[]]$vpgName
+3 -3
View File
@@ -4,7 +4,7 @@ function Invoke-ZertoMove {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of the VPG(s) you want to move.", HelpMessage = "Name(s) of the VPG(s) you want to move.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
@@ -29,13 +29,13 @@ function Invoke-ZertoMove {
[Parameter( [Parameter(
ParameterSetName = "disableReverseProtection", ParameterSetName = "disableReverseProtection",
HelpMessage = "Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.", HelpMessage = "Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.",
Mandatory = $true Mandatory
)] )]
[switch]$disableReverseProtection, [switch]$disableReverseProtection,
[Parameter( [Parameter(
ParameterSetName = "keepSourceVms", ParameterSetName = "keepSourceVms",
HelpMessage = "Prevent the protected virtual machines from being deleted in the protected site. Using this setting disables reverse protection.", HelpMessage = "Prevent the protected virtual machines from being deleted in the protected site. Using this setting disables reverse protection.",
Mandatory = $true Mandatory
)] )]
[switch]$keepSourceVms, [switch]$keepSourceVms,
[Parameter( [Parameter(
@@ -4,7 +4,7 @@ function Invoke-ZertoMoveCommit {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of the VPG(s) to commit.", HelpMessage = "Name(s) of the VPG(s) to commit.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
@@ -20,7 +20,7 @@ function Invoke-ZertoMoveCommit {
begin { begin {
$baseUri = "vpgs" $baseUri = "vpgs"
$body = @{} $body = @{ }
if ($reverseProtection) { if ($reverseProtection) {
$body["ReverseProtection"] = $true $body["ReverseProtection"] = $true
} elseif ($keepSourceVms) { } elseif ($keepSourceVms) {
@@ -4,7 +4,7 @@ function Invoke-ZertoMoveRollback {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to roll back from failing over", HelpMessage = "Name(s) of VPG(s) to roll back from failing over",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName [string[]]$vpgName
+18 -18
View File
@@ -4,7 +4,7 @@ function New-ZertoVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name of the VPG", HelpMessage = "Name of the VPG",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$vpgName, [string]$vpgName,
@@ -20,89 +20,89 @@ function New-ZertoVpg {
[int]$journalHistoryInHours = 24, [int]$journalHistoryInHours = 24,
[Parameter( [Parameter(
HelpMessage = "Name(s) of the VM(s) to be protected.", HelpMessage = "Name(s) of the VM(s) to be protected.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$protectedVm, [string[]]$protectedVm,
[Parameter( [Parameter(
HelpMessage = "Name of the site where the VM(s) will be recovered", HelpMessage = "Name of the site where the VM(s) will be recovered",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$recoverySite, [string]$recoverySite,
[Parameter( [Parameter(
HelpMessage = "Name of the cluster where the VM(s) will be recovered.", HelpMessage = "Name of the cluster where the VM(s) will be recovered.",
ParameterSetName = "recoveryClusterDatastore", ParameterSetName = "recoveryClusterDatastore",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the cluster where the VM(s) will be recovered.", HelpMessage = "Name of the cluster where the VM(s) will be recovered.",
ParameterSetName = "recoveryClusterDatastoreCluster", ParameterSetName = "recoveryClusterDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$recoveryCluster, [string]$recoveryCluster,
[Parameter( [Parameter(
HelpMessage = "Name of the host where the VM(s) will be recovered.", HelpMessage = "Name of the host where the VM(s) will be recovered.",
ParameterSetName = "recoveryHostDatastore", ParameterSetName = "recoveryHostDatastore",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the host where the VM(s) will be recovered.", HelpMessage = "Name of the host where the VM(s) will be recovered.",
ParameterSetName = "recoveryHostDatastoreCluster", ParameterSetName = "recoveryHostDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$recoveryHost, [string]$recoveryHost,
[Parameter( [Parameter(
HelpMessage = "Name of the resource pool where the VM(s) will be recovered.", HelpMessage = "Name of the resource pool where the VM(s) will be recovered.",
ParameterSetName = "recoveryResourcePoolDatastore", ParameterSetName = "recoveryResourcePoolDatastore",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the resource pool where the VM(s) will be recovered.", HelpMessage = "Name of the resource pool where the VM(s) will be recovered.",
ParameterSetName = "recoveryResourcePoolDatastoreCluster", ParameterSetName = "recoveryResourcePoolDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$recoveryResourcePool, [string]$recoveryResourcePool,
[Parameter( [Parameter(
HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryClusterDatastore", ParameterSetName = "recoveryClusterDatastore",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryHostDatastore", ParameterSetName = "recoveryHostDatastore",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryResourcePoolDatastore", ParameterSetName = "recoveryResourcePoolDatastore",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$datastore, [string]$datastore,
[Parameter( [Parameter(
HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryClusterDatastoreCluster", ParameterSetName = "recoveryClusterDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryHostDatastoreCluster", ParameterSetName = "recoveryHostDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[Parameter( [Parameter(
HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.",
ParameterSetName = "recoveryResourcePoolDatastoreCluster", ParameterSetName = "recoveryResourcePoolDatastoreCluster",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$datastoreCluster, [string]$datastoreCluster,
[Parameter( [Parameter(
HelpMessage = "Name of folder at recovery location where the recovered virtual machine(s) will be created.", HelpMessage = "Name of folder at recovery location where the recovered virtual machine(s) will be created.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$recoveryFolder, [string]$recoveryFolder,
@@ -132,13 +132,13 @@ function New-ZertoVpg {
[String]$zorg, [String]$zorg,
[Parameter( [Parameter(
HelpMessage = "Name of the network to use during a Failover Live \ Move VPG operation.", HelpMessage = "Name of the network to use during a Failover Live \ Move VPG operation.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[String]$recoveryNetwork, [String]$recoveryNetwork,
[Parameter( [Parameter(
HelpMessage = "Name of the network to use during a Failover Test operation", HelpMessage = "Name of the network to use during a Failover Test operation",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$testNetwork, [string]$testNetwork,
@@ -5,7 +5,7 @@ function New-ZertoVpgSettingsIdentifier {
[Parameter( [Parameter(
HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch.", HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch.",
ParameterSetName = "existingVpg", ParameterSetName = "existingVpg",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true ValueFromPipelineByPropertyName = $true
)] )]
@@ -15,7 +15,7 @@ function New-ZertoVpgSettingsIdentifier {
[Parameter( [Parameter(
HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG", HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG",
ParameterSetName = "newVpg", ParameterSetName = "newVpg",
Mandatory = $true Mandatory
)] )]
[switch]$newVpg [switch]$newVpg
) )
@@ -10,7 +10,7 @@ function Remove-ZertoPeerSite {
ParameterSetName = "siteIdentifier", ParameterSetName = "siteIdentifier",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[Alias("siteId")] [Alias("siteId")]
@@ -20,7 +20,7 @@ function Remove-ZertoPeerSite {
ParameterSetName = "peerSiteName", ParameterSetName = "peerSiteName",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$peerSiteName, [string[]]$peerSiteName,
@@ -29,9 +29,9 @@ function Remove-ZertoPeerSite {
ParameterSetName = "hostName", ParameterSetName = "hostName",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
Mandatory = $true Mandatory
)] )]
[ValidateScript( {$_ -match [IPAddress]$_ })] [ValidateScript( { $_ -match [IPAddress]$_ })]
[string[]]$hostName, [string[]]$hostName,
[Parameter( [Parameter(
HelpMessage = "Specify this switch to Keep the target replica disks for any VPGs replicating between the sites as the VPGs will be deleted by unpairing the sites. If this switch is not used, the target replica disks will be deleted" HelpMessage = "Specify this switch to Keep the target replica disks for any VPGs replicating between the sites as the VPGs will be deleted by unpairing the sites. If this switch is not used, the target replica disks will be deleted"
@@ -41,7 +41,7 @@ function Remove-ZertoPeerSite {
begin { begin {
$baseUri = "peersites" $baseUri = "peersites"
$body = @{} $body = @{ }
if ( $keepTargetDisks ) { if ( $keepTargetDisks ) {
$body['IsKeepTargetDisks'] = $true $body['IsKeepTargetDisks'] = $true
} else { } else {
+3 -3
View File
@@ -3,7 +3,7 @@ function Remove-ZertoVpg {
[cmdletbinding( SupportsShouldProcess = $true, DefaultParameterSetName = "vpgIdentifier" )] [cmdletbinding( SupportsShouldProcess = $true, DefaultParameterSetName = "vpgIdentifier" )]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
ParameterSetName = "vpgName", ParameterSetName = "vpgName",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
@@ -12,7 +12,7 @@ function Remove-ZertoVpg {
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
ParameterSetName = "vpgIdentifier", ParameterSetName = "vpgIdentifier",
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
@@ -33,7 +33,7 @@ function Remove-ZertoVpg {
begin { begin {
$baseUri = "vpgs" $baseUri = "vpgs"
$body = @{} $body = @{ }
if ($keepRecoveryVolumes) { if ($keepRecoveryVolumes) {
$body['KeepRecoveryVolumes'] = $True $body['KeepRecoveryVolumes'] = $True
} else { } else {
+1 -1
View File
@@ -4,7 +4,7 @@ function Resume-ZertoVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to resume replication", HelpMessage = "Name(s) of VPG(s) to resume replication",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName [string[]]$vpgName
@@ -6,7 +6,7 @@ function Save-ZertoVpgSetting {
param( param(
[Parameter( [Parameter(
HelpMessage = "VpgSettings Identifier to save", HelpMessage = "VpgSettings Identifier to save",
Mandatory = $true, Mandatory,
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true ValueFromPipelineByPropertyName = $true
)] )]
+3 -3
View File
@@ -5,7 +5,7 @@ function Set-ZertoAlert {
[Parameter( [Parameter(
ValueFromPipeline = $true, ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true, ValueFromPipelineByPropertyName = $true,
Mandatory = $true, Mandatory,
HelpMessage = "Alert identifier(s) to be dismissed or undismissed." HelpMessage = "Alert identifier(s) to be dismissed or undismissed."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -13,13 +13,13 @@ function Set-ZertoAlert {
[string[]]$alertId, [string[]]$alertId,
[Parameter( [Parameter(
ParameterSetName = "dismiss", ParameterSetName = "dismiss",
Mandatory = $true, Mandatory,
HelpMessage = "Will dismiss the selected alert." HelpMessage = "Will dismiss the selected alert."
)] )]
[switch]$dismiss, [switch]$dismiss,
[Parameter( [Parameter(
ParameterSetName = "undismiss", ParameterSetName = "undismiss",
Mandatory = $true, Mandatory,
HelpMessage = "Will undismiss the selected alert." HelpMessage = "Will undismiss the selected alert."
)] )]
[switch]$undismiss [switch]$undismiss
+2 -2
View File
@@ -3,7 +3,7 @@ function Set-ZertoLicense {
[cmdletbinding( SupportsShouldProcess = $true )] [cmdletbinding( SupportsShouldProcess = $true )]
param ( param (
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "License Key to apply to the Zerto Virtual Manager" HelpMessage = "License Key to apply to the Zerto Virtual Manager"
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@@ -12,7 +12,7 @@ function Set-ZertoLicense {
begin { begin {
$baseUri = "license" $baseUri = "license"
$body = @{"LicenseKey" = $licenseKey} $body = @{"LicenseKey" = $licenseKey }
} }
process { process {
@@ -4,7 +4,7 @@ function Start-ZertoCloneVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name of the VPG you wish to clone.", HelpMessage = "Name of the VPG you wish to clone.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$vpgName, [string]$vpgName,
@@ -36,7 +36,7 @@ function Start-ZertoCloneVpg {
if ( $PSBoundParameters.ContainsKey('datastoreName') ) { if ( $PSBoundParameters.ContainsKey('datastoreName') ) {
$recoverysiteIdentifier = $vpgInfo.recoverysite.identifier $recoverysiteIdentifier = $vpgInfo.recoverysite.identifier
$recoverySiteDatastores = Get-ZertoVirtualizationSite -siteIdentifier $recoverysiteIdentifier -datastores $recoverySiteDatastores = Get-ZertoVirtualizationSite -siteIdentifier $recoverysiteIdentifier -datastores
$datastoreIdentifier = $($recoverySiteDatastores | Where-Object {$_.datastoreName -like $datastoreName}).DatastoreIdentifier $datastoreIdentifier = $($recoverySiteDatastores | Where-Object { $_.datastoreName -like $datastoreName }).DatastoreIdentifier
if ( -not $datastoreIdentifier ) { if ( -not $datastoreIdentifier ) {
Write-Error "Datastore: $datastoreName is not a valid datastore. Please check the name and try again." -ErrorAction Stop Write-Error "Datastore: $datastoreName is not a valid datastore. Please check the name and try again." -ErrorAction Stop
} }
@@ -45,7 +45,7 @@ function Start-ZertoCloneVpg {
$vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName $vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName
[System.Collections.ArrayList]$vmIdentifiers = @() [System.Collections.ArrayList]$vmIdentifiers = @()
foreach ( $name in $vmName ) { foreach ( $name in $vmName ) {
$selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()} $selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() }
if ($null -eq $selectedVm) { if ($null -eq $selectedVm) {
Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop
} elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) { } elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) {
@@ -63,7 +63,7 @@ function Start-ZertoCloneVpg {
process { process {
$uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier
$body = [ordered]@{} $body = [ordered]@{ }
if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) { if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) {
$body['checkpointId'] = $checkpointIdentifier $body['checkpointId'] = $checkpointIdentifier
} }
@@ -4,7 +4,7 @@ function Start-ZertoFailoverTest {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name of VPG to failover test", HelpMessage = "Name of VPG to failover test",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$vpgName, [string]$vpgName,
@@ -4,7 +4,7 @@ function Stop-ZertoCloneVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name of the VPG to stop cloning", HelpMessage = "Name of the VPG to stop cloning",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$vpgName [string]$vpgName
@@ -4,7 +4,7 @@ function Stop-ZertoFailoverTest {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to stop testing.", HelpMessage = "Name(s) of VPG(s) to stop testing.",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName, [string[]]$vpgName,
@@ -21,7 +21,7 @@ function Stop-ZertoFailoverTest {
begin { begin {
$baseUri = "vpgs" $baseUri = "vpgs"
$body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary} $body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary }
} }
process { process {
+1 -1
View File
@@ -4,7 +4,7 @@ function Suspend-ZertoVpg {
param( param(
[Parameter( [Parameter(
HelpMessage = "Name(s) of VPG(s) to pause replication", HelpMessage = "Name(s) of VPG(s) to pause replication",
Mandatory = $true Mandatory
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string[]]$vpgName [string[]]$vpgName
@@ -3,7 +3,7 @@ function Uninstall-ZertoVra {
[cmdletbinding()] [cmdletbinding()]
param( param(
[Parameter( [Parameter(
Mandatory = $true, Mandatory,
HelpMessage = "Host Name attached to the VRA to be removed." HelpMessage = "Host Name attached to the VRA to be removed."
)] )]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]