59a0a53812
* Establish a help system * Continue to update Help System * Update Get-ZertoAlert.md * Update Get-ZertoDatastore.md * Add Link to Zerto API for Datastores * Update Get-ZertoLicense.md * Update Links to Zerto API documentation * Update the Readme Information * Continue to update README * Update README * Update README.md * Update Help Markdown Files * Correct API URL * Update ZertoApiWrapper-help.xml * Update Get-ZertoProtectedVm.md * Update Help Markdown files * Update Get-ZertoVpgSetting.md * Added online url to each help object. * Update Help Markdown Files * Update ZertoApiWrapper-help.xml
32 lines
800 B
PowerShell
32 lines
800 B
PowerShell
<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #>
|
|
function Uninstall-ZertoVra {
|
|
[cmdletbinding()]
|
|
param(
|
|
[Parameter(
|
|
Mandatory = $true,
|
|
HelpMessage = "Host Name attached to the VRA to be removed."
|
|
)]
|
|
[string[]]$hostName
|
|
)
|
|
|
|
begin {
|
|
$baseUri = "vras"
|
|
}
|
|
|
|
process {
|
|
foreach ($name in $hostName) {
|
|
$vraName = "Z-VRA-{0}" -f $name
|
|
$vraIdentifier = get-zertovra -vraName $vraName | Select-Object vraIdentifier -ExpandProperty vraIdentifier
|
|
$uri = "{0}/{1}" -f $baseUri, $vraIdentifier.toString()
|
|
Invoke-ZertoRestRequest -uri $uri -method "DELETE"
|
|
if ($hostName.Count -gt 1) {
|
|
Start-Sleep 1
|
|
}
|
|
}
|
|
}
|
|
|
|
end {
|
|
|
|
}
|
|
}
|