Files
ZertoApiWrapper/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1
T
2019-04-16 22:46:21 -04:00

34 lines
884 B
PowerShell

<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
function Stop-ZertoCloneVpg {
[cmdletbinding( SupportsShouldProcess = $true )]
param(
[Parameter(
HelpMessage = "Name of the VPG to stop cloning",
Mandatory = $true
)]
[ValidateNotNullOrEmpty()]
[string]$vpgName
)
begin {
$baseUri = "vpgs"
$vpgIdentifier = $(Get-ZertoVpg -name $vpgName).vpgIdentifier
if ( -not $vpgIdentifier ) {
Write-Error "VPG: $vpgName could not be found. Please check the name and try again." -ErrorAction Stop
}
}
process {
$uri = "{0}/{1}/CloneAbort" -f $baseUri, $vpgIdentifier
if ($PSCmdlet.ShouldProcess("Stopping VPG Clone Operation")) {
invoke-ZertoRestRequest -uri $uri -method "POST"
}
}
end {
# Nothing to do
}
}