diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index 1e79659..c87cab7 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -47,8 +47,9 @@ function Get-ZertoEvent { [string]$zorgIdentifier, [Parameter( ParameterSetName = "filter", - HelpMessage = "The type of entity for which you wish to return results. Possible Values are: '0' or 'VPG', '1' or 'VRA', '2' or 'Unknown', or '3' or 'Site'" + HelpMessage = "The type of entity for which you wish to return results. Possible Values are: 'VPG', 'VRA', 'Unknown', or 'Site'" )] + [ValidateSet("VPG", "VRA", "Unknown", "Site")] [string]$entityType, [Parameter( ParameterSetName = "filter", @@ -57,13 +58,15 @@ function Get-ZertoEvent { [string]$userName, [Parameter( ParameterSetName = "filter", - HelpMessage = "The type of event to return. This filter behaves in the same way as the eventCategory filter. Possible Values are: Possible Values are: '0' or 'All', '1' or 'Events', '2' or 'Alerts'" + HelpMessage = "The type of event to return. This filter behaves in the same way as the eventCategory filter. Possible Values are: Possible Values are: 'All', 'Events', 'Alerts'" )] + [string]$category, [Parameter( ParameterSetName = "filter", - HelpMessage = " This filter behaves in the same way as the category filter. If both category and eventCategory filters are specified, only the category filter value is used and the eventCategory filter value is ignored. The type of event to return. Possible Values are: '0' or 'All', '1' or 'Events', '2' or 'Alerts'" + HelpMessage = " This filter behaves in the same way as the category filter. If both category and eventCategory filters are specified, only the category filter value is used and the eventCategory filter value is ignored. The type of event to return. Possible Values are: 'All', 'Events', 'Alerts'" )] + [ValidateSet("All", "Events", "Alerts")] [string]$eventCategory, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 index 429a8cd..9dc58ae 100644 --- a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 @@ -38,8 +38,9 @@ function Get-ZertoProtectedVm { [string]$organizationName, [Parameter( ParameterSetName = "filter", - HelpMessage = "The priority specified for the VPG. Possible values are: '0' or 'Low', '1' or 'Medium', '2' or 'High'" + HelpMessage = "The priority specified for the VPG. Possible values are: 'Low', 'Medium', or 'High'" )] + [ValidateSet("Low", "Medium", "High")] [string]$priority, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 index 9f3b5ae..1e4997e 100644 --- a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 @@ -36,6 +36,7 @@ function Get-ZertoRecoveryReport { ParameterSetName = "filter", HelpMessage = "The type of recovery operations. Possible values are: 'Failover', 'Failover Test', or 'Move'" )] + [ValidateSet("Failover", "Failover Test", "Move")] [string]$recoveryType, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoTask.ps1 b/ZertoApiWrapper/Public/Get-ZertoTask.ps1 index ce23e3c..fb670bc 100644 --- a/ZertoApiWrapper/Public/Get-ZertoTask.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoTask.ps1 @@ -40,8 +40,9 @@ function Get-ZertoTask { [string]$type, [Parameter( ParameterSetName = "filter", - HelpMessage = "The status of the task. Possible values are: '1' or 'InProgress', '3' or 'Paused', '4' or 'Failed', '6' or 'Completed', '7' or 'Cancelling'" + HelpMessage = "The status of the task. Possible values are: 'InProgress', 'Paused', 'Failed', 'Completed', or 'Cancelling'" )] + [ValidateSet("InProgress", "Paused", "Failed", "Completed", "Cancelling")] [string]$status ) diff --git a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 index 3c4ef0c..b3d686a 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 @@ -130,8 +130,9 @@ function Get-ZertoVpg { [string]$zorgIdentifier, [Parameter( ParameterSetName = "filter", - HelpMessage = "The VPG priority. Possible values are: '0' or 'Low', '1' or 'Medium', '2' or 'High'" + HelpMessage = "The VPG priority. Possible values are: 'Low', 'Medium', 'High'" )] + [ValidateSet("Low", "Medium", "High")] [string]$priority, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 index b96379a..75f70cc 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 @@ -13,11 +13,12 @@ function Invoke-ZertoFailover { [Alias("checkpointId")] [string]$checkpointIdentifier, [Parameter( - HelpMessage = "0: After the seconds specified in the commitValue setting have elapsed, the failover is rolled back. - 1: After the seconds specified in the commitValue setting have elapsed, the failover continues, committing the virtual machines in the recovery site. - 2: The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover. + HelpMessage = "'Rollback': After the seconds specified in the commitValue setting have elapsed, the failover is rolled back. + 'Commit': After the seconds specified in the commitValue setting have elapsed, the failover continues, committing the virtual machines in the recovery site. + 'None': The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover. Default is the Site Settings setting." )] + [ValidateSet("Rollback", "Commit", "None")] [string]$commitPolicy, [Parameter( HelpMessage = "The amount of time in seconds the failover waits in a Before Commit state to enable checking that the failover is as required before performing the commitPolicy setting. Default is the Site Setting" @@ -28,6 +29,7 @@ function Invoke-ZertoFailover { 1: If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the virtual machines are gracefully shut down, otherwise the failover operation fails. This is similar to performing a Move operation to a specified checkpoint. 2: The protected virtual machines are forcibly shut down before starting the failover. If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the procedure waits five minutes for the virtual machines to be gracefully shut down before forcibly powering them off. This is similar to performing a Move operation to a specified checkpoint." )] + [ValidateSet(0, 1, 2)] [int]$shutdownPolicy = 0, [Parameter( HelpMessage = "Time, in seconds, before VMs are forcibly turned off if the Force Shutdown option is seclected after attempting to gracefully shut down the VMs" @@ -39,7 +41,7 @@ function Invoke-ZertoFailover { )] [bool]$reverseProtection, [Parameter( - HelpMessage = "Name(s) of VMs in the " + HelpMessage = "Name(s) of VMs in the VPG to failover" )] [string[]]$vmName ) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index a245da9..1007b5d 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -8,8 +8,12 @@ function Invoke-ZertoMove { )] [string[]]$vpgName, [Parameter( - HelpMessage = "The policy to use after the move enters a 'Before Commit' state. If omitted, the site settings default will be applied. Valid values are: '0' or 'Rollback', '1' or 'Commit', '2' or 'None'. Please see Zerto API Documentation for additional information." + HelpMessage = "'Rollback': After the seconds specified in the commitValue setting have elapsed, the failover is rolled back. + 'Commit': After the seconds specified in the commitValue setting have elapsed, the failover continues, committing the virtual machines in the recovery site. + 'None': The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover. + Default is the Site Settings setting." )] + [ValidateSet("Rollback", "Commit", "None")] [string]$commitPolicy, [Parameter( HelpMessage = "The amount of time, in seconds, the Move is in a 'Before Commit' state, before performing the commitPolicy setting. If omitted, the site settings default will be applied." @@ -76,4 +80,4 @@ function Invoke-ZertoMove { end { # Nothing to do. } -} \ No newline at end of file +} diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 753554a..020a309 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -21,7 +21,8 @@ function New-ZertoVpg { HelpMessage = "Name(s) of the VM(s) to be protected.", Mandatory = $true )] - [ValidateNotNullOrEmpty()][string[]]$protectedVm, + [ValidateNotNullOrEmpty()] + [string[]]$protectedVm, [Parameter( HelpMessage = "Name of the site where the VM(s) will be recovered", Mandatory = $true @@ -100,11 +101,13 @@ function New-ZertoVpg { [Parameter( HelpMessage = "RPO alert" )] - [ValidateRange(60, 864200)][Int32]$rpoInSeconds = 300, + [ValidateRange(60, 864200)] + [Int32]$rpoInSeconds = 300, [Parameter( HelpMessage = "Minimum test interval for this VPG. Valid values are 0: Off, 43200: 1 Month, 131040: 3 Months, 262080: 6 Months, 294560: 9 Months, 252600: 12 Months" )] - [ValidateSet(0, 43200, 131040, 262080, 294560, 252600)][int]$testIntervalInMinutes = 262080, + [ValidateSet(0, 43200, 131040, 262080, 294560, 252600)] + [int]$testIntervalInMinutes = 262080, [Parameter( HelpMessage = "Service profile name to use." )] diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 index 7984a30..b3cedcf 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 @@ -22,11 +22,11 @@ function Remove-ZertoVpg { [Parameter( HelpMessage = "Use this parameter to keep the recovery volumes at the target site, by setting it to True. If the virtual machines in the deleted VPG are reprotected, these volumes can be used as preseeded volumes to speed up the initial synchronization of the new VPG. Default is to remove Recovery Volumes" )] - [switch]$keepRecoveryVolumes = $false, + [switch]$keepRecoveryVolumes, [Parameter( HelpMessage = "Use this parameter to force delete the VPG, by setting this parameter equal to true." )] - [switch]$force = $false + [switch]$force ) begin {