From ec4ac7ae5f3bb6ddb0d221ad5680237d3008c2aa Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 27 Feb 2019 14:07:46 -0500 Subject: [PATCH] Update FailoverTestStop with additional options. --- .../Public/Invoke-ZertoFailoverTestStop.ps1 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoFailoverTestStop.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoFailoverTestStop.ps1 index 0f1d7e8..b148830 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoFailoverTestStop.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoFailoverTestStop.ps1 @@ -2,21 +2,30 @@ function Invoke-ZertoFailoverTestStop { [cmdletbinding()] param( [Parameter( - HelpMessage = "Name(s) of VPG(s) to roll back from failing over", + HelpMessage = "Name(s) of VPG(s) to stop testing.", Mandatory = $true )] - [string[]]$vpgName + [string[]]$vpgName, + [Parameter( + HelpMessage = "Was the test successful? True or False. True is Default." + )] + [bool]$failoverTestSuccess = $true, + [Parameter( + HelpMessage = "Free text field for any notes to add to the test report." + )] + [string]$failoverTestSummary = "Stop Failover Test for $vpgName" ) begin { $baseUri = "vpgs" + $body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary} } process { foreach ($name in $vpgName) { - $id = $(Get-ZertoVpg -name $name).vpgIdentifier - $uri = "{0}/{1}/FailoverTestStop" -f $baseUri, $id - Invoke-ZertoRestRequest -uri $uri -method "POST" + $vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier + $uri = "{0}/{1}/FailoverTestStop" -f $baseUri, $vpgId + Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json) } }