Create switch when creating new VPG Settings
This commit is contained in:
@@ -2,17 +2,31 @@ function New-ZertoVpgSettingsIdentifier {
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[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",
|
||||
Mandatory = $true,
|
||||
ValueFromPipeline = $true,
|
||||
ValueFromPipelineByPropertyName = $true
|
||||
)]
|
||||
[string]$vpgIdentifier = $null
|
||||
[string]$vpgIdentifier,
|
||||
[Parameter(
|
||||
HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG",
|
||||
ParameterSetName = "newVpg",
|
||||
Mandatory = $true
|
||||
)]
|
||||
[switch]$newVpg
|
||||
)
|
||||
|
||||
begin {
|
||||
$baseUri = "vpgSettings"
|
||||
if ($null -eq $vpgIdentifier) {
|
||||
$body = "{}"
|
||||
} else {
|
||||
$body = "{""VpgIdentifier"":""$vpgIdentifier""}"
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
"newVpg" {
|
||||
$body = "{}"
|
||||
}
|
||||
|
||||
"existingVpg" {
|
||||
$body = "{""VpgIdentifier"":""$vpgIdentifier""}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +37,4 @@ function New-ZertoVpgSettingsIdentifier {
|
||||
end {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user