Add ShouldProcess support
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
|
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
|
||||||
function Invoke-ZertoMoveRollback {
|
function Invoke-ZertoMoveRollback {
|
||||||
[cmdletbinding()]
|
[cmdletbinding(SupportsShouldProcess = $true)]
|
||||||
param(
|
param(
|
||||||
[Parameter(
|
[Parameter(
|
||||||
HelpMessage = "Name(s) of VPG(s) to roll back from failing over",
|
HelpMessage = "Name(s) of VPG(s) to roll back from failing over",
|
||||||
@@ -20,7 +20,9 @@ function Invoke-ZertoMoveRollback {
|
|||||||
Write-Error "VPG: $name not found. Please check the name and try again."
|
Write-Error "VPG: $name not found. Please check the name and try again."
|
||||||
} else {
|
} else {
|
||||||
$uri = "{0}/{1}/moveRollBack" -f $baseUri, $id
|
$uri = "{0}/{1}/moveRollBack" -f $baseUri, $id
|
||||||
Invoke-ZertoRestRequest -uri $uri -method "POST"
|
if ($PSCmdlet.ShouldProcess("Rolling back VPG: $name")) {
|
||||||
|
Invoke-ZertoRestRequest -uri $uri -method "POST"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user