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,6 +6,7 @@ function Stop-ZertoFailoverTest {
HelpMessage = "Name(s) of VPG(s) to stop testing.",
Mandatory = $true
)]
[ValidateNotNullOrEmpty()]
[string[]]$vpgName,
[Parameter(
HelpMessage = "Was the test successful? True or False. True is Default."
@@ -25,11 +26,13 @@ function Stop-ZertoFailoverTest {
process {
foreach ($name in $vpgName) {
$vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier
if ( -not $vpgId) {
Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop
}
$uri = "{0}/{1}/FailoverTestStop" -f $baseUri, $vpgId
if ($PSCmdlet.ShouldProcess("Stopping Failover Test")) {
Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json)
}
}
}