PowerCLI Reference

Remove-VMHostRoute

Synopsis

This cmdlet removes host routes.

Syntax

Remove-VMHostRoute [-VMHostRoute] <VMHostRoute[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostRoute
New-VMHostRoute
Set-VMHostRoute

Detailed Description

This cmdlet removes host routes.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VMHostRouteVMHostRoute[]Specifies the host routes you want to remove.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

None

Notes

Supported only on ESX 4.1/ vCenter Server 4.1 and later.

Examples

-------------- Example 1 --------------

$destIpList = ('192.168.111.101', '192.168.111.102')

$routes = Get-VMHostRoute -VMHost ($script:vmhost1, $script:vmhost2) | where {$destIpList -contains $_.Destination.IPAddressToString}

Remove-VMHostRoute -VMHostRoute $routes -Confirm:$false

Removes the host routes that have the specified destination IP addresses.


Copyright © VMware, Inc. All rights reserved.