Files
ZertoApiWrapper/ZertoApiWrapper/Public/Invoke-ZertoForceSync.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

34 lines
805 B
PowerShell

<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml
#>
function Invoke-ZertoForceSync {
[cmdletbinding()]
param(
[Parameter(
HelpMessage = "Name(s) of VPG(s) to force sync",
Mandatory
)]
[ValidateNotNullOrEmpty()]
[string[]]$vpgName
)
begin {
$baseUri = "vpgs"
}
process {
foreach ($name in $vpgName) {
$id = $(Get-ZertoVpg -name $name).vpgIdentifier
if ( -not $id ) {
Write-Error "VPG: $name not found. Please check the name and try again. Skipping"
} else {
$uri = "{0}/{1}/forcesync" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri -method "POST"
}
}
}
end {
#Nothing to do
}
}