Create switch when creating new VPG Settings

This commit is contained in:
Wes Carroll
2019-03-14 20:29:13 -04:00
parent a91e2a034b
commit 59f83cbb8a
@@ -2,17 +2,31 @@ function New-ZertoVpgSettingsIdentifier {
[cmdletbinding()] [cmdletbinding()]
param( param(
[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",
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 { begin {
$baseUri = "vpgSettings" $baseUri = "vpgSettings"
if ($null -eq $vpgIdentifier) { switch ($PSCmdlet.ParameterSetName) {
$body = "{}" "newVpg" {
} else { $body = "{}"
$body = "{""VpgIdentifier"":""$vpgIdentifier""}" }
"existingVpg" {
$body = "{""VpgIdentifier"":""$vpgIdentifier""}"
}
} }
} }
@@ -23,4 +37,4 @@ function New-ZertoVpgSettingsIdentifier {
end { end {
} }
} }