From 8ec3293ff47b819c71d24b73e5b0a37b7885761e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 16 Apr 2019 22:46:21 -0400 Subject: [PATCH] String Not Null or Empty Validators --- ZertoApiWrapper/Public/Get-ZertoAlert.ps1 | 9 +++++++++ ZertoApiWrapper/Public/Get-ZertoDatastore.ps1 | 1 + ZertoApiWrapper/Public/Get-ZertoEvent.ps1 | 16 ++++++++++++++-- ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 | 5 +++++ ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 | 10 ++++++++++ .../Public/Get-ZertoRecoveryReport.ps1 | 7 +++++++ .../Public/Get-ZertoResourcesReport.ps1 | 17 +++++++++++++++++ .../Public/Get-ZertoServiceProfile.ps1 | 3 +++ ZertoApiWrapper/Public/Get-ZertoTask.ps1 | 6 ++++++ .../Public/Get-ZertoVirtualizationSite.ps1 | 2 ++ ZertoApiWrapper/Public/Get-ZertoVolume.ps1 | 5 +++++ ZertoApiWrapper/Public/Get-ZertoVpg.ps1 | 13 +++++++++++++ ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 | 4 ++++ ZertoApiWrapper/Public/Get-ZertoVra.ps1 | 10 ++++++++++ ZertoApiWrapper/Public/Get-ZertoZorg.ps1 | 1 + ZertoApiWrapper/Public/Get-ZertoZsspSession.ps1 | 1 + ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 1 + ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 15 +++++++++++++++ .../Public/New-ZertoVpgSettingsIdentifier.ps1 | 1 + ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 | 2 ++ ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 | 2 ++ ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 | 1 + ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 | 1 + ZertoApiWrapper/Public/Set-ZertoAlert.ps1 | 4 ++-- ZertoApiWrapper/Public/Set-ZertoLicense.ps1 | 1 + ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 | 4 ++++ .../Public/Start-ZertoFailoverTest.ps1 | 3 +++ ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 | 1 + .../Public/Stop-ZertoFailoverTest.ps1 | 1 + ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 | 1 + ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 | 1 + 31 files changed, 145 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 index 1375ba5..1ee27f6 100644 --- a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 @@ -9,6 +9,7 @@ function Get-ZertoAlert { ValueFromPipelineByPropertyName = $true , HelpMessage = "AlertId or array of AlertIds to be queried" )] + [ValidateNotNullOrEmpty()] [string[]]$alertId, [Parameter( ParameterSetName = "entities", @@ -32,45 +33,53 @@ function Get-ZertoAlert { ParameterSetName = "filter", HelpMessage = "Returns Alerts after the Start Date. Provide the string in the format of 'yyyy-MM-ddTHH:mm:ss.fff'" )] + [ValidateNotNullOrEmpty()] [string]$startDate, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns Alerts before the End Date. Provide the string in the format of 'yyyy-MM-ddTHH:mm:ss.fff'" )] + [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified vraIdentifier" )] + [ValidateNotNullOrEmpty()] [Alias("vpgId")] [string]$vpgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified siteIdentifier" )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string]$siteIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified zorgIdentifier" )] + [ValidateNotNullOrEmpty()] [Alias("zorgId")] [string]$zorgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified level" )] + [ValidateNotNullOrEmpty()] [string]$level, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified helpIdentifier" )] + [ValidateNotNullOrEmpty()] [Alias("helpId")] [string]$helpIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "Returns alerts for the specified entity" )] + [ValidateNotNullOrEmpty()] [string]$entity, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoDatastore.ps1 b/ZertoApiWrapper/Public/Get-ZertoDatastore.ps1 index 46f10ae..8584e90 100644 --- a/ZertoApiWrapper/Public/Get-ZertoDatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoDatastore.ps1 @@ -7,6 +7,7 @@ function Get-ZertoDatastore { ParameterSetName = "datastoreIdentifier", HelpMessage = "datastoreIdentifier or array of datastoreIdentifiers to be queried" )] + [ValidateNotNullOrEmpty()] [string[]]$datastoreIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index c87cab7..1c45ee8 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -6,43 +6,51 @@ function Get-ZertoEvent { ParameterSetName = "filter", HelpMessage = "The starting date for the list of events, supplied as a date with the format of the Zerto Virtual Manager where the API runs, for example, yyyy-MM-dd. You can also specify a local time with the following format: yyyy-MM-ddTHH:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startDate, [Parameter( ParameterSetName = "filter", HelpMessage = "The end date for the list, supplied as a date with the format of the Zerto Virtual Manager where the API runs, for example, yyyy-MM-dd. You can also specify a local time with the following format: yyyy-MM-ddTHH:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the VPG for which you want to return events." )] + [ValidateNotNullOrEmpty()] [Alias("vpgName")] [string]$vpg, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the VPG for which you want to return events." )] + [ValidateNotNullOrEmpty()] [Alias("vpgId")] [string]$vpgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The type of event. For the description of events, refer to the Zerto Virtual Replication documentation about alerts and events. Please see Zerto API Documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$eventType, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the site for which you want to return events." )] + [ValidateNotNullOrEmpty()] [string]$siteName, [Parameter( ParameterSetName = "filter", HelpMessage = "The internal site identifier for which you want to return events." )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string]$siteIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the ZORG, Zerto organization, defined in the Zerto Cloud Manager for which you want to return results." )] + [ValidateNotNullOrEmpty()] [Alias("zorgId")] [string]$zorgIdentifier, [Parameter( @@ -55,12 +63,13 @@ function Get-ZertoEvent { ParameterSetName = "filter", HelpMessage = "The name of the user for which the event occurred. If the event occurred as a result of a task started by the Zerto Virtual Manager, for example, when moving a VPG before the commit stage, the user is System." )] + [ValidateNotNullOrEmpty()] [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: 'All', 'Events', 'Alerts'" )] - + [ValidateNotNullOrEmpty()] [string]$category, [Parameter( ParameterSetName = "filter", @@ -72,6 +81,7 @@ function Get-ZertoEvent { ParameterSetName = "filter", HelpMessage = "The internal alert identifier for the Event" )] + [ValidateNotNullOrEmpty()] [Alias("alertId")] [string]$alertIdentifier, [Parameter( @@ -79,7 +89,9 @@ function Get-ZertoEvent { Mandatory = $true, ValueFromPipeline = $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." + )] + [ValidateNotNullOrEmpty()] [string[]]$eventId, [Parameter( ParameterSetName = "categories", diff --git a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 index 1b8b4f2..8f64673 100644 --- a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 @@ -15,6 +15,7 @@ function Get-ZertoPeerSite { ValueFromPipelineByPropertyName = $true, HelpMessage = "The identifier(s) of the peer site(s) for which information is to be returned." )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string[]]$siteIdentifier, [Parameter( @@ -26,21 +27,25 @@ function Get-ZertoPeerSite { ParameterSetName = "filter", HelpMessage = "The pairing status for which information is to be returned." )] + [ValidateNotNullOrEmpty()] [string]$paringStatus, [Parameter ( ParameterSetName = "filter", HelpMessage = "The site location, as specified in the site information, for which information is to be returned." )] + [ValidateNotNullOrEmpty()] [string]$location, [Parameter ( ParameterSetName = "filter", HelpMessage = "The IP address of a Zerto Virtual Manager, paired with this site, for which information is to be returned." )] + [ValidateNotNullOrEmpty()] [string]$hostName, [Parameter ( ParameterSetName = "filter", HelpMessage = "The port used to access peer sites for which information is to be returned. The default port is 9081." )] + [ValidateNotNullOrEmpty()] [string]$port ) diff --git a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 index 9dc58ae..36dc2aa 100644 --- a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 @@ -9,32 +9,38 @@ function Get-ZertoProtectedVm { ValueFromPipelineByPropertyName = $true, HelpMessage = "vmIdentifier(s) for which to return information" )] + [ValidateNotNullOrEmpty()] [Alias("vmId")] [string[]]$vmIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the VPG which protects the virtual machine." )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the virtual machine." )] + [ValidateNotNullOrEmpty()] [string]$vmName, [Parameter( ParameterSetName = "filter", HelpMessage = "The status of the VPG. Please see Zerto API documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$status, [Parameter( ParameterSetName = "filter", HelpMessage = "The substatus of the VPG, for example the VPG is in a bitmap sync. For the description of substatuses, refer to the Zerto Virtual Manager Administration Guide. Please see Zerto API documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$substatus, [Parameter( ParameterSetName = "filter", HelpMessage = "The ZORG for this VPG." )] + [ValidateNotNullOrEmpty()] [string]$organizationName, [Parameter( ParameterSetName = "filter", @@ -46,22 +52,26 @@ function Get-ZertoProtectedVm { ParameterSetName = "filter", HelpMessage = "The protected site type. Please see Zerto API documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$protectedSiteType, [Parameter( ParameterSetName = "filter", HelpMessage = "The recovery site type. Please see Zerto API documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$recoverySiteType, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the protected site where the VPG virtual machines are protected." )] + [ValidateNotNullOrEmpty()] [Alias("protectedSiteId")] [string]$protectedSiteIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the recovery site where the VPG virtual machines are recovered." )] + [ValidateNotNullOrEmpty()] [Alias("recoverySiteId")] [string]$recoverySiteIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 index 1e4997e..c15ba9c 100644 --- a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 @@ -6,31 +6,37 @@ function Get-ZertoRecoveryReport { ParameterSetName = "filter", HelpMessage = "Operations performed between the specified start Time and end Time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startTime, [Parameter( ParameterSetName = "filter", HelpMessage = "Operations performed between the specified start Time and end Time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$endTime, [Parameter( ParameterSetName = "filter", HelpMessage = "The page number the user wants to retrieve. Minimum value is 1." )] + [ValidateNotNullOrEmpty()] [string]$pageNumber, [Parameter( ParameterSetName = "filter", HelpMessage = "The number of reports to display in a single page. The maximum number of reports per page is 1000." )] + [ValidateNotNullOrEmpty()] [string]$pageSize, [Parameter( ParameterSetName = "filter", HelpMessage = "The internal identifier of the VPG. You can specify more than one VPG, separated by commas." )] + [ValidateNotNullOrEmpty()] [string]$vpgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the VPG. You can specify more than one VPG, separated by commas." )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( ParameterSetName = "filter", @@ -42,6 +48,7 @@ function Get-ZertoRecoveryReport { ParameterSetName = "filter", HelpMessage = "Whether the recovery operation has completed." )] + [ValidateNotNullOrEmpty()] [string]$state ) diff --git a/ZertoApiWrapper/Public/Get-ZertoResourcesReport.ps1 b/ZertoApiWrapper/Public/Get-ZertoResourcesReport.ps1 index ce35557..f447777 100644 --- a/ZertoApiWrapper/Public/Get-ZertoResourcesReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoResourcesReport.ps1 @@ -6,86 +6,103 @@ function Get-ZertoResourcesReport { ParameterSetName = "filter", HelpMessage = "Operations performed between the specified start Time and end Time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startTime, [Parameter( ParameterSetName = "filter", HelpMessage = "Operations performed between the specified start Time and end Time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$endTime, [Parameter( ParameterSetName = "filter", HelpMessage = "The page number to retrieve. Minimum value is 1" )] + [ValidateNotNullOrEmpty()] [string]$pageNumber, [Parameter( ParameterSetName = "filter", HelpMessage = "The number of reports to display in a single page. The maximum number of reports per page is 1000." )] + [ValidateNotNullOrEmpty()] [string]$pageSize, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the organization set up in the Zerto Cloud Manager." )] + [ValidateNotNullOrEmpty()] [string]$zorgName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the virtual machine." )] + [ValidateNotNullOrEmpty()] [string]$vmName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the VPG." )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the protected site." )] + [ValidateNotNullOrEmpty()] [string]$protectedSiteName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the cluster containing the host where the virtual machine in the recovery site resides." )] + [ValidateNotNullOrEmpty()] [string]$protectedClusterName, [Parameter( ParameterSetName = "filter", HelpMessage = "The address or DNS name of the host where the virtual machine in the recovery site resides." )] + [ValidateNotNullOrEmpty()] [string]$protectedHostName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the vDC organization in the protected site." )] + [ValidateNotNullOrEmpty()] [string]$protectedOrgVdc, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the vCD organization in the protected site." )] + [ValidateNotNullOrEmpty()] [string]$protectedVdcOrg, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the recovery site." )] + [ValidateNotNullOrEmpty()] [string]$recoverySiteName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the cluster containing the host where the virtual machine in the recovery site resides." )] + [ValidateNotNullOrEmpty()] [string]$recoveryClusterName, [Parameter( ParameterSetName = "filter", HelpMessage = "The address or DNS name of the host where the virtual machine in the recovery site resides." )] + [ValidateNotNullOrEmpty()] [string]$recoveryHostName, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the vDC organization in the recovery site." )] + [ValidateNotNullOrEmpty()] [string]$recoveryOrgVdc, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the recovery vCD organization." )] + [ValidateNotNullOrEmpty()] [string]$recoveryVdcOrg ) diff --git a/ZertoApiWrapper/Public/Get-ZertoServiceProfile.ps1 b/ZertoApiWrapper/Public/Get-ZertoServiceProfile.ps1 index 4081a9d..76a5e2e 100644 --- a/ZertoApiWrapper/Public/Get-ZertoServiceProfile.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoServiceProfile.ps1 @@ -6,12 +6,15 @@ function Get-ZertoServiceProfile { ParameterSetName = "siteIdentifier", HelpMessage = "The identifier of the site for which service profiles should be returned." )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string]$siteIdentifier, [Parameter( ParameterSetName = "serviceProfileId", HelpMessage = "The service profile ID for which information should be returned." )] + [ValidateNotNullOrEmpty()] + [Alias("serviceProfileIdentifier")] [string[]]$serviceProfileId ) diff --git a/ZertoApiWrapper/Public/Get-ZertoTask.ps1 b/ZertoApiWrapper/Public/Get-ZertoTask.ps1 index fb670bc..d8f1537 100644 --- a/ZertoApiWrapper/Public/Get-ZertoTask.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoTask.ps1 @@ -6,6 +6,7 @@ function Get-ZertoTask { ParameterSetName = "taskIdentifier", HelpMessage = "The identifier(s) for which task information is to be returned." )] + [ValidateNotNullOrEmpty()] [Alias("taskId")] [string[]]$taskIdentifier, [Parameter( @@ -17,26 +18,31 @@ function Get-ZertoTask { ParameterSetName = "filter", HelpMessage = "Tasks started before this time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startedBeforeDate, [Parameter( ParameterSetName = "filter", HelpMessage = "Tasks started after this time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startedAfterDate, [Parameter( ParameterSetName = "filter", HelpMessage = "Tasks completed after this time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$completedAfterDate, [Parameter( ParameterSetName = "filter", HelpMessage = "Tasks completed before this time (inclusive) are displayed. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$completedBeforeDate, [Parameter( ParameterSetName = "filter", HelpMessage = "The type of task. For the description of the tasks, refer to the Zerto Virtual Replication documentation about monitoring tasks. Please see Zerto API Documentation for possible types and values." )] + [ValidateNotNullOrEmpty()] [string]$type, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 index a7e4e01..e296887 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 @@ -52,6 +52,7 @@ function Get-ZertoVirtualizationSite { Mandatory = $true, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string]$siteIdentifier, [Parameter( @@ -82,6 +83,7 @@ function Get-ZertoVirtualizationSite { Mandatory = $false, HelpMessage = "The identifier of the host at the selected site to return information for only one host." )] + [ValidateNotNullOrEmpty()] [Alias("hostId")] [string]$hostIdentifier, [Parameter( diff --git a/ZertoApiWrapper/Public/Get-ZertoVolume.ps1 b/ZertoApiWrapper/Public/Get-ZertoVolume.ps1 index 6f44002..dee5130 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVolume.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVolume.ps1 @@ -6,29 +6,34 @@ function Get-ZertoVolume { ParameterSetName = "filter", HelpMessage = "The type of volume. Please see Zerto API Documentation for possible values." )] + [ValidateNotNullOrEmpty()] [string]$volumeType, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the VPG." )] + [ValidateNotNullOrEmpty()] [Alias("vpgId")] [string]$vpgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the datastore." )] + [ValidateNotNullOrEmpty()] [Alias("datastoreId", "dsId")] [string]$datastoreIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the protected virtual machine." )] + [ValidateNotNullOrEmpty()] [Alias("protectedVmId")] [string]$protectedVmIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the owning virtual machine." )] + [ValidateNotNullOrEmpty()] [Alias("owningVmId")] [string]$owningVmIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 index ac7d614..d151152 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 @@ -17,6 +17,7 @@ function Get-ZertoVpg { Mandatory = $true, HelpMessage = "The identifier(s) of the Virtual Protection Group to return" )] + [ValidateNotNullOrEmpty()] [Alias("vpgId", "protectionGroupId", "pgId")] [string[]]$protectionGroupIdentifier, [Parameter( @@ -29,11 +30,13 @@ function Get-ZertoVpg { ParameterSetName = "checkpoints", HelpMessage = "Return checkpoints after the specified start date. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$startDate, [Parameter( ParameterSetName = "checkpoints", HelpMessage = "Return checkpoints before the specified start date. Valid formats include: 'yyyy-MM-ddTHH:mm:ss.fffZ', 'yyyy-MM-ddTHH:mm:ssZ', 'yyyy-MM-ddTHH:mmZ', 'yyyy-MM-ddTHHZ', 'yyyy-MM-dd', 'yyyy-MM', 'yyyy'. Adding Z to the end of the time sets the time to UTC." )] + [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( ParameterSetName = "stats", Mandatory = $true, @@ -86,47 +89,56 @@ function Get-ZertoVpg { ParameterSetName = "filter", HelpMessage = "The name of the VPG." )] + [ValidateNotNullOrEmpty()] [Alias("vpgName")] [string]$name, [Parameter( ParameterSetName = "filter", HelpMessage = "The status of the VPG. Please use 'Get-ZertoVpg -statuses' for valid values" )] + [ValidateNotNullOrEmpty()] [string]$status, [Parameter( ParameterSetName = "filter", HelpMessage = "The substatus of the VPG. Please use 'Get-ZertoVpg -substatuses' for valid values" )] + [ValidateNotNullOrEmpty()] [string]$subStatus, [Parameter( ParameterSetName = "filter", HelpMessage = "The protected site environment. This filter behaves in the same way as the sourceType filter. Please see Zerto API Documentation for vaild values and discriptions." )] + [ValidateNotNullOrEmpty()] [string]$protectedSiteType, [Parameter( ParameterSetName = "filter", HelpMessage = "The recovery site environment. This filter behaves in the same way as the sourceType filter. Please see Zerto API Documentation for vaild values and discriptions." )] + [ValidateNotNullOrEmpty()] [string]$recoverySiteType, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the protected site where the VPG virtual machines are protected." )] + [ValidateNotNullOrEmpty()] [string]$protectedSiteIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the protected site where the VPG virtual machines are recovered." )] + [ValidateNotNullOrEmpty()] [string]$recoverySiteIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The ZORG for this VPG." )] + [ValidateNotNullOrEmpty()] [string]$organizationName, [Parameter( ParameterSetName = "filter", HelpMessage = "The internal identifier for the ZORG." )] + [ValidateNotNullOrEmpty()] [string]$zorgIdentifier, [Parameter( ParameterSetName = "filter", @@ -138,6 +150,7 @@ function Get-ZertoVpg { ParameterSetName = "filter", HelpMessage = "The identifier of the service profile to use for the VPG when a Zerto Cloud Manager is used." )] + [ValidateNotNullOrEmpty()] [string]$serviceProfileIdentifier, [Parameter( ParameterSetName = "filter", diff --git a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 index 5c68f54..a5b8f53 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 @@ -131,6 +131,7 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] + [ValidateNotNullOrEmpty()] [Alias("vpgSettingsId", "settingsId")] [string]$vpgSettingsIdentifier, [Parameter( @@ -230,6 +231,7 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "VM Identifier" )] + [ValidateNotNullOrEmpty()] [Alias("vmId")] [string]$vmIdentifier, [Parameter( @@ -243,6 +245,7 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "Return NIC information for specified NIC of the specified VM" )] + [ValidateNotNullOrEmpty()] [Alias("nicId")] [string]$nicIdentifier, [Parameter( @@ -256,6 +259,7 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "Return volume information for the specified volume of the specified VM" )] + [ValidateNotNullOrEmpty()] [Alias("volumeId")] [string]$volumeIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZertoVra.ps1 b/ZertoApiWrapper/Public/Get-ZertoVra.ps1 index 410ff7e..e94d08b 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVra.ps1 @@ -18,52 +18,62 @@ function Get-ZertoVra { ParameterSetName = "vraIdentifier", HelpMessage = "Returns information for provided VRA identifier(s)" )] + [ValidateNotNullOrEmpty()] [Alias("vraId")] [string[]]$vraIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "VRA Name to return information for." )] + [ValidateNotNullOrEmpty()] [string]$vraName, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs in a specific status" )] + [ValidateNotNullOrEmpty()] [string]$status, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs of a specific version" )] + [ValidateNotNullOrEmpty()] [string]$vraVersion, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs paired to a specific host version" )] + [ValidateNotNullOrEmpty()] [string]$hostVersion, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for a VRA with the specified IP address" )] + [ValidateNotNullOrEmpty()] [string]$ipAddress, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs belonging to a specific group" )] + [ValidateNotNullOrEmpty()] [string]$vraGroup, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs on a specific datastore" )] + [ValidateNotNullOrEmpty()] [string]$datastoreName, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs on a specific datastore cluster" )] + [ValidateNotNullOrEmpty()] [string]$datastoreClusterName, [Parameter( ParameterSetName = "filter", HelpMessage = "Search for VRAs on a specific network" )] + [ValidateNotNullOrEmpty()] [string]$networkName ) diff --git a/ZertoApiWrapper/Public/Get-ZertoZorg.ps1 b/ZertoApiWrapper/Public/Get-ZertoZorg.ps1 index 5d17d29..27f39ee 100644 --- a/ZertoApiWrapper/Public/Get-ZertoZorg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoZorg.ps1 @@ -6,6 +6,7 @@ function Get-ZertoZorg { ParameterSetName = "zorgIdentifier", HelpMessage = "Identifier(s) of the ZORG." )] + [ValidateNotNullOrEmpty()] [Alias("zorgId")] [string[]]$zorgIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZertoZsspSession.ps1 b/ZertoApiWrapper/Public/Get-ZertoZsspSession.ps1 index 2d6b293..1c11b36 100644 --- a/ZertoApiWrapper/Public/Get-ZertoZsspSession.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoZsspSession.ps1 @@ -6,6 +6,7 @@ function Get-ZertoZsspSession { ParameterSetName = "zsspSessionIdentifier", HelpMessage = "ZSSP Session Id(s) to get information." )] + [ValidateNotNullOrEmpty()] [Alias("zsspSessionId")] [string[]]$zsspSessionIdentifier ) diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 2aad0a8..2bca65f 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -16,6 +16,7 @@ function Install-ZertoVra { [ValidateRange(1, 16)] [int]$memoryInGB = 3, [Parameter( HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will assign to the 'default_group'" )] + [ValidateNotNullOrEmpty()] [string]$groupName, [Parameter( ParameterSetName = "Dhcp", Mandatory = $true, HelpMessage = "Assign a DHCP address to the VRA." )] [switch]$Dhcp, diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 21ea609..a4885f5 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -6,6 +6,7 @@ function New-ZertoVpg { HelpMessage = "Name of the VPG", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( HelpMessage = "VPG Priority. High, Medium, or Low. Default value is Medium" @@ -27,6 +28,7 @@ function New-ZertoVpg { HelpMessage = "Name of the site where the VM(s) will be recovered", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$recoverySite, [Parameter( HelpMessage = "Name of the cluster where the VM(s) will be recovered.", @@ -38,6 +40,7 @@ function New-ZertoVpg { ParameterSetName = "recoveryClusterDatastoreCluster", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$recoveryCluster, [Parameter( HelpMessage = "Name of the host where the VM(s) will be recovered.", @@ -49,6 +52,7 @@ function New-ZertoVpg { ParameterSetName = "recoveryHostDatastoreCluster", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$recoveryHost, [Parameter( HelpMessage = "Name of the resource pool where the VM(s) will be recovered.", @@ -60,6 +64,7 @@ function New-ZertoVpg { ParameterSetName = "recoveryResourcePoolDatastoreCluster", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$recoveryResourcePool, [Parameter( HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", @@ -76,6 +81,7 @@ function New-ZertoVpg { ParameterSetName = "recoveryResourcePoolDatastore", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$datastore, [Parameter( HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", @@ -92,11 +98,13 @@ function New-ZertoVpg { ParameterSetName = "recoveryResourcePoolDatastoreCluster", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$datastoreCluster, [Parameter( HelpMessage = "Name of folder at recovery location where the recovered virtual machine(s) will be created.", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$recoveryFolder, [Parameter( HelpMessage = "RPO alert" @@ -111,6 +119,7 @@ function New-ZertoVpg { [Parameter( HelpMessage = "Service profile name to use." )] + [ValidateNotNullOrEmpty()] [string]$serviceProfile, [Parameter( HelpMessage = "Turn on or off WAN and Journal Compression. Default is turned on." @@ -119,31 +128,37 @@ function New-ZertoVpg { [Parameter( HelpMessage = "Name of ZORG to use." )] + [ValidateNotNullOrEmpty()] [String]$zorg, [Parameter( HelpMessage = "Name of the network to use during a Failover Live \ Move VPG operation.", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [String]$recoveryNetwork, [Parameter( HelpMessage = "Name of the network to use during a Failover Test operation", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$testNetwork, [Parameter( HelpMessage = "Name of the datastore to utilize to store Journal data. If not specified, the default datastore will be used.", Mandatory = $false )] + [ValidateNotNullOrEmpty()] [string]$journalDatastore, [Parameter( HelpMessage = "Default journal hard limit in megabytes. Default set to 153600 MB (150 GB). Set to 0 to set the journal to unlimited", Mandatory = $false )] + [ValidateNotNullOrEmpty()] [uint64]$journalHardLimitInMb = 153600, [Parameter( HelpMessage = "Default journal warning threshold in megabytes. If unset or greater than the hard limit, will be set to 75% of the journal hard limit.", Mandatory = $false )] + [ValidateNotNullOrEmpty()] [uint64]$journalWarningThresholdInMb = 0 ) diff --git a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 index cd52e5b..07273b8 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 @@ -9,6 +9,7 @@ function New-ZertoVpgSettingsIdentifier { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] + [ValidateNotNullOrEmpty()] [Alias("vpgId")] [string]$vpgIdentifier, [Parameter( diff --git a/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 index 6eb8740..0d818e9 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 @@ -12,6 +12,7 @@ function Remove-ZertoPeerSite { ValueFromPipelineByPropertyName = $true, Mandatory = $true )] + [ValidateNotNullOrEmpty()] [Alias("siteId")] [string[]]$siteIdentifier, [Parameter( @@ -21,6 +22,7 @@ function Remove-ZertoPeerSite { ValueFromPipelineByPropertyName = $true, Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string[]]$peerSiteName, [Parameter( HelpMessage = "IP address of the peer site to be removed from the connected site", diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 index 8aafb91..5e453fb 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 @@ -9,6 +9,7 @@ function Remove-ZertoVpg { ValueFromPipelineByPropertyName = $true, HelpMessage = "Name(s) of the VPG(s) to delete." )] + [ValidateNotNullOrEmpty()] [string[]]$vpgName, [Parameter( Mandatory = $true, @@ -17,6 +18,7 @@ function Remove-ZertoVpg { ValueFromPipelineByPropertyName = $true, HelpMessage = "vpgIdentifier(s) of the VPG(s) to delete." )] + [ValidateNotNullOrEmpty()] [Alias("vpgId")] [string[]]$vpgidentifier, [Parameter( diff --git a/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 index e258d0c..24e1c8f 100644 --- a/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 @@ -6,6 +6,7 @@ function Resume-ZertoVpg { HelpMessage = "Name(s) of VPG(s) to resume replication", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string[]]$vpgName ) diff --git a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 index 8e06784..64c9127 100644 --- a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 @@ -10,6 +10,7 @@ function Save-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] + [ValidateNotNullOrEmpty()] [Alias("vpgSettingsId")] [string]$vpgSettingsIdentifier ) diff --git a/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 index 8724476..1969177 100644 --- a/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 @@ -2,14 +2,14 @@ function Set-ZertoAlert { [cmdletbinding( SupportsShouldProcess = $true )] param ( - [Alias("identifier")] [Parameter( ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "Alert identifier(s) to be dismissed or undismissed." )] - [Alias("alertIdentifier")] + [ValidateNotNullOrEmpty()] + [Alias("alertIdentifier", "identifier", "id")] [string[]]$alertId, [Parameter( ParameterSetName = "dismiss", diff --git a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 index 3c5de54..6ce7e32 100644 --- a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 @@ -6,6 +6,7 @@ function Set-ZertoLicense { Mandatory = $true, HelpMessage = "License Key to apply to the Zerto Virtual Manager" )] + [ValidateNotNullOrEmpty()] [string]$licenseKey ) diff --git a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 index adf82ff..1678c8b 100644 --- a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 @@ -6,19 +6,23 @@ function Start-ZertoCloneVpg { HelpMessage = "Name of the VPG you wish to clone.", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( HelpMessage = "The identifier of the checkpoint to use for cloning. If unspecified, the latest checkpoint will be used." )] + [ValidateNotNullOrEmpty()] [Alias("checkpointId")] [string]$checkpointIdentifier, [Parameter( HelpMessage = "The datastore name where the clone is to be created. If unspecified, will auto select the datastore with the most free space." )] + [ValidateNotNullOrEmpty()] [string]$datastoreName, [Parameter( HelpMessage = "The name(s) of the VMs you wish to clone. If unspecified, all VMs in the VPG will be cloned." )] + [ValidateNotNullOrEmpty()] [string[]]$vmName ) diff --git a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 index 6d5ecc5..ee044e3 100644 --- a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 @@ -6,15 +6,18 @@ function Start-ZertoFailoverTest { HelpMessage = "Name of VPG to failover test", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$vpgName, [Parameter( HelpMessage = "The identifier of the checkpoint to use for testing. If unspecified, the latest checkpoint will be used." )] + [ValidateNotNullOrEmpty()] [Alias("checkpointId")] [string]$checkpointIdentifier, [Parameter( HelpMessage = "The name(s) of the VMs within the selected VPG you wish to test. If unspecified, all VMs in the VPG will be tested." )] + [ValidateNotNullOrEmpty()] [string[]]$vmName ) diff --git a/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 index 746238e..6e78ade 100644 --- a/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 @@ -6,6 +6,7 @@ function Stop-ZertoCloneVpg { HelpMessage = "Name of the VPG to stop cloning", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$vpgName ) diff --git a/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 b/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 index 7593077..babb190 100644 --- a/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 +++ b/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 @@ -15,6 +15,7 @@ function Stop-ZertoFailoverTest { [Parameter( HelpMessage = "Free text field for any notes to add to the test report." )] + [ValidateNotNullOrEmpty()] [string]$failoverTestSummary = "Stop Failover Test for $vpgName" ) diff --git a/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 index 68e8bee..c590859 100644 --- a/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 @@ -6,6 +6,7 @@ function Suspend-ZertoVpg { HelpMessage = "Name(s) of VPG(s) to pause replication", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string[]]$vpgName ) diff --git a/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 index 31496ff..b62f332 100644 --- a/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 @@ -6,6 +6,7 @@ function Uninstall-ZertoVra { Mandatory = $true, HelpMessage = "Host Name attached to the VRA to be removed." )] + [ValidateNotNullOrEmpty()] [string[]]$hostName )