Add Param Aliases

This commit is contained in:
Wes Carroll
2019-03-26 14:28:00 -04:00
parent 1e82c04687
commit 76b228589e
23 changed files with 42 additions and 2 deletions
@@ -7,10 +7,12 @@ function Connect-ZertoServer {
HelpMessage = "IP address or FQDN of your Zerto Management Server"
)]
[ValidateNotNullOrEmpty()]
[Alias("server", "zvm")]
[string]$zertoServer,
[Parameter(
HelpMessage = "Zerto Virtual Manager management port. Default value is 9669."
)]
[Alias("port")]
[string]$zertoPort = "9669",
[Parameter(
Mandatory = $true,
+1
View File
@@ -6,6 +6,7 @@ function Edit-ZertoVra {
Mandatory = $true,
HelpMessage = "Identifier of the VRA to be updated."
)]
[Alias("vraId")]
[string]$vraIdentifier,
[Parameter(
HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will not modify current assignment"
@@ -42,16 +42,19 @@ function Get-ZertoAlert {
ParameterSetName = "filter",
HelpMessage = "Returns alerts for the specified vraIdentifier"
)]
[Alias("vpgId")]
[string]$vpgIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "Returns alerts for the specified siteIdentifier"
)]
[Alias("siteId")]
[string]$siteIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "Returns alerts for the specified zorgIdentifier"
)]
[Alias("zorgId")]
[string]$zorgIdentifier,
[Parameter(
ParameterSetName = "filter",
@@ -62,6 +65,7 @@ function Get-ZertoAlert {
ParameterSetName = "filter",
HelpMessage = "Returns alerts for the specified helpIdentifier"
)]
[Alias("helpId")]
[string]$helpIdentifier,
[Parameter(
ParameterSetName = "filter",
@@ -2,6 +2,7 @@
function Get-ZertoDatastore {
[cmdletbinding( DefaultParameterSetName = "main" )]
param(
[Alias("datastoreId")]
[Parameter(
ParameterSetName = "datastoreIdentifier",
HelpMessage = "datastoreIdentifier or array of datastoreIdentifiers to be queried"
@@ -16,11 +16,13 @@ function Get-ZertoEvent {
ParameterSetName = "filter",
HelpMessage = "The name of the VPG for which you want to return events."
)]
[Alias("vpgName")]
[string]$vpg,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the VPG for which you want to return events."
)]
[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."
@@ -35,11 +37,13 @@ function Get-ZertoEvent {
ParameterSetName = "filter",
HelpMessage = "The internal site identifier for which you want to return events."
)]
[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."
)]
[Alias("zorgId")]
[string]$zorgIdentifier,
[Parameter(
ParameterSetName = "filter",
@@ -65,6 +69,7 @@ function Get-ZertoEvent {
ParameterSetName = "filter",
HelpMessage = "The internal alert identifier for the Event"
)]
[Alias("alertId")]
[string]$alertIdentifier,
[Parameter(
ParameterSetName = "eventId",
@@ -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."
)]
[Alias("siteId")]
[string[]]$siteIdentifier,
[Parameter(
ParameterSetName = "filter",
@@ -9,6 +9,7 @@ function Get-ZertoProtectedVm {
ValueFromPipelineByPropertyName = $true,
HelpMessage = "vmIdentifier(s) for which to return information"
)]
[Alias("vmId")]
[string[]]$vmIdentifier,
[Parameter(
ParameterSetName = "filter",
@@ -54,11 +55,13 @@ function Get-ZertoProtectedVm {
ParameterSetName = "filter",
HelpMessage = "The identifier of the protected site where the VPG virtual machines are protected."
)]
[Alias("protectedSiteId")]
[string]$protectedSiteIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the recovery site where the VPG virtual machines are recovered."
)]
[Alias("recoverySiteId")]
[string]$recoverySiteIdentifier
)
@@ -6,6 +6,7 @@ function Get-ZertoServiceProfile {
ParameterSetName = "siteIdentifier",
HelpMessage = "The identifier of the site for which service profiles should be returned."
)]
[Alias("siteId")]
[string]$siteIdentifier,
[Parameter(
ParameterSetName = "serviceProfileId",
+1
View File
@@ -6,6 +6,7 @@ function Get-ZertoTask {
ParameterSetName = "taskIdentifier",
HelpMessage = "The identifier(s) for which task information is to be returned."
)]
[Alias("taskId")]
[string[]]$taskIdentifier,
[Parameter(
ParameterSetName = "types",
@@ -52,6 +52,7 @@ function Get-ZertoVirtualizationSite {
Mandatory = $true,
HelpMessage = "The identifier of the Zerto Virtual Manager site."
)]
[Alias("siteId")]
[string]$siteIdentifier,
[Parameter(
ParameterSetName = "datastoreClusters",
@@ -81,6 +82,7 @@ function Get-ZertoVirtualizationSite {
Mandatory = $false,
HelpMessage = "The identifier of the host at the selected site to return information for only one host."
)]
[Alias("hostId")]
[string]$hostIdentifier,
[Parameter(
ParameterSetName = "folders",
@@ -11,21 +11,25 @@ function Get-ZertoVolume {
ParameterSetName = "filter",
HelpMessage = "The identifier of the VPG."
)]
[Alias("vpgId")]
[string]$vpgIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the datastore."
)]
[Alias("datastoreId", "dsId")]
[string]$datastoreIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the protected virtual machine."
)]
[Alias("protectedVmId")]
[string]$protectedVmIdentifier,
[Parameter(
ParameterSetName = "filter",
HelpMessage = "The identifier of the owning virtual machine."
)]
[Alias("owningVmId")]
[string]$owningVmIdentifier
)
+1
View File
@@ -17,6 +17,7 @@ function Get-ZertoVpg {
Mandatory = $true,
HelpMessage = "The identifier(s) of the Virtual Protection Group to return"
)]
[Alias("vpgId", "protectionGroupId", "pgId")]
[string[]]$protectionGroupIdentifier,
[Parameter(
ParameterSetName = "checkpoints",
@@ -131,6 +131,7 @@ function Get-ZertoVpgSetting {
Mandatory = $true,
HelpMessage = "The identifier of the VPG settings object for which information is retrieved."
)]
[Alias("vpgSettingsId", "settingsId")]
[string]$vpgSettingsIdentifier,
[Parameter(
ParameterSetName = "backup",
@@ -229,6 +230,7 @@ function Get-ZertoVpgSetting {
Mandatory = $true,
HelpMessage = "VM Identifier"
)]
[Alias("vmId")]
[string]$vmIdentifier,
[Parameter(
ParameterSetName = "nics",
@@ -241,6 +243,7 @@ function Get-ZertoVpgSetting {
Mandatory = $true,
HelpMessage = "Return NIC information for specified NIC of the specified VM"
)]
[Alias("nicId")]
[string]$nicIdentifier,
[Parameter(
ParameterSetName = "volumes",
@@ -253,6 +256,7 @@ function Get-ZertoVpgSetting {
Mandatory = $true,
HelpMessage = "Return volume information for the specified volume of the specified VM"
)]
[Alias("volumeId")]
[string]$volumeIdentifier
)
+1
View File
@@ -18,6 +18,7 @@ function Get-ZertoVra {
ParameterSetName = "vraIdentifier",
HelpMessage = "Returns information for provided VRA identifier(s)"
)]
[Alias("vraId")]
[string[]]$vraIdentifier,
[Parameter(
ParameterSetName = "filter",
+1
View File
@@ -6,6 +6,7 @@ function Get-ZertoZorg {
ParameterSetName = "zorgIdentifier",
HelpMessage = "Identifier(s) of the ZORG."
)]
[Alias("zorgId")]
[string[]]$zorgIdentifier
)
@@ -6,6 +6,7 @@ function Get-ZertoZsspSession {
ParameterSetName = "zsspSessionIdentifier",
HelpMessage = "ZSSP Session Id(s) to get information."
)]
[Alias("zsspSessionId")]
[string[]]$zsspSessionIdentifier
)
@@ -10,6 +10,7 @@ function Invoke-ZertoFailover {
[Parameter(
HelpMessage = "Checkpoint Identifier to use as the Point-In-Time to rollback to."
)]
[Alias("checkpointId")]
[string]$checkpointIdentifier,
[Parameter(
HelpMessage = "0: After the seconds specified in the commitValue setting have elapsed, the failover is rolled back.
@@ -8,6 +8,7 @@ function New-ZertoVpgSettingsIdentifier {
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true
)]
[Alias("vpgId")]
[string]$vpgIdentifier,
[Parameter(
HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG",
@@ -17,6 +17,7 @@ function Remove-ZertoVpg {
ValueFromPipelineByPropertyName = $true,
HelpMessage = "vpgIdentifier(s) of the VPG(s) to delete."
)]
[Alias("vpgId")]
[string[]]$vpgidentifier,
[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"
@@ -10,6 +10,7 @@ function Save-ZertoVpgSettings {
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true
)]
[Alias("vpgSettingsId")]
[string]$vpgSettingsIdentifier
)
@@ -17,4 +18,4 @@ function Save-ZertoVpgSettings {
if ($PSCmdlet.ShouldProcess("Commiting VPG Settings with Settigns identifier $vpgSettingsIdentifier")) {
Invoke-ZertoRestRequest -uri $baseUri -method "POST"
}
}
}
+2 -1
View File
@@ -9,6 +9,7 @@ function Set-ZertoAlert {
Mandatory = $true,
HelpMessage = "Alert identifier(s) to be dismissed or undismissed."
)]
[Alias("alertIdentifier")]
[string[]]$alertId,
[Parameter(
ParameterSetName = "dismiss",
@@ -40,4 +41,4 @@ function Set-ZertoAlert {
end {
# Nothing to do.
}
}
}
@@ -10,6 +10,7 @@ function Start-ZertoCloneVpg {
[Parameter(
HelpMessage = "The identifier of the checkpoint to use for cloning. If unspecified, the latest checkpoint will be used."
)]
[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."
@@ -10,6 +10,7 @@ function Start-ZertoFailoverTest {
[Parameter(
HelpMessage = "The identifier of the checkpoint to use for testing. If unspecified, the latest checkpoint will be used."
)]
[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."