Validate identifiers are present

This commit is contained in:
Wes Carroll
2019-04-05 22:49:36 -04:00
parent e279ba0cda
commit 5bf7d0d6df
18 changed files with 109 additions and 45 deletions
+6 -2
View File
@@ -16,8 +16,12 @@ function Suspend-ZertoVpg {
process {
foreach ($name in $vpgName) {
$id = $(Get-ZertoVpg -name $name).vpgIdentifier
$uri = "{0}/{1}/pause" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri -method "POST"
if ( -not $id ) {
Write-Error "VPG: $name not found. Skipping."
} else {
$uri = "{0}/{1}/pause" -f $baseUri, $id
Invoke-ZertoRestRequest -uri $uri -method "POST"
}
}
}