Files
ZertoApiWrapper/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1
T
justin 869db85705 working branch updates
Lots of updates to improve vscode syntax highlighting as well as some updates to the main invoke rest command per chatgpt recommendations :)
2025-02-09 20:35:40 -05:00

35 lines
876 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
)]
[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
}
}