Create switch when creating new VPG Settings
This commit is contained in:
@@ -2,19 +2,33 @@ 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) {
|
||||||
|
"newVpg" {
|
||||||
$body = "{}"
|
$body = "{}"
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
"existingVpg" {
|
||||||
$body = "{""VpgIdentifier"":""$vpgIdentifier""}"
|
$body = "{""VpgIdentifier"":""$vpgIdentifier""}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
process {
|
process {
|
||||||
Invoke-ZertoRestRequest -uri $baseUri -body $body -Method "POST"
|
Invoke-ZertoRestRequest -uri $baseUri -body $body -Method "POST"
|
||||||
|
|||||||
Reference in New Issue
Block a user