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