From 6800c0c24b6f6fa1194391156ea3d31c19bdf0e5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 20 Feb 2019 22:14:40 -0500 Subject: [PATCH] Create Uninstall-ZertoVra.ps1 --- ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 diff --git a/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 new file mode 100644 index 0000000..6d08c85 --- /dev/null +++ b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 @@ -0,0 +1,24 @@ +function Uninstall-ZertoVra { + [cmdletbinding()] + param( + [Parameter( Mandatory = $true )] + [string[]]$hostName + ) + + begin { + $baseUri = "vras" + } + + process { + foreach ($name in $hostName) { + $vraName = "Z-VRA-{0}" -f $name + $vraIdentifier = get-zertovra -vraName | Select-Object vraIdentifier -ExpandProperty vraIdentifier + $uri = "{0}/{1}" -f $baseUri, $vraIdentifier.toString() + Invoke-ZertoRestRequest -uri $uri -method "DELETE" + } + } + + end { + + } +} \ No newline at end of file