Create Uninstall-ZertoVra.ps1

This commit is contained in:
Wes Carroll
2019-02-20 22:14:40 -05:00
parent b8f8354ce1
commit 6800c0c24b
@@ -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 {
}
}