powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-VMHostRoute



NAME
Set-VMHostRoute

SYNOPSIS
Modifies a route in the host routing table.

SYNTAX
Set-VMHostRoute [-VMHostRoute] [-Destination ] [-Gateway ] [-PrefixLength t32>] [-WhatIf] [-Confirm] []


DESCRIPTION
Modifies a route in the host routing table.


PARAMETERS
-VMHostRoute
Specify the route you want to modify.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Destination
Change the destination IP address of the route.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Gateway
Change the gateway IP address of the route.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-PrefixLength
Modify the prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IP
v6 - from 0 to 128.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
If 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.

Required? false
Position? named
Default value $true
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VMHostRoute[]


NOTES


Supported only on ESX 4.0/ vCenter Server 4.0 and newer.

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

C:\PS>$hostroute = New-VMHostRoute -VMHost 10.23.114.189 -Destination 192.168.104.101 -Gateway 10.23.84.69 -PrefixL
ength 32

$hostroute | Set-VMHostRoute -Gateway 10.23.84.70


Creates a new host route and modifies its gateway.





-------------- Example 2 --------------

C:\PS>$hostroute1 = New-VMHostRoute -VMHost 10.23.114.189 -Destination 192.168.104.101 -Gateway 10.23.84.69 -Prefix
Length 32

$hostroute2 = New-VMHostRoute -VMHost 10.23.114.190 -Destination 192.168.104.101 -Gateway 10.23.84.70 -PrefixLength
32

Set-VMHostRoute -VMHostRoute ($hostroute1, $hostroute2) -Destination 192.168.104.0 -PrefixLength 24


Modifies the destination and the prefix length of two host routes.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-VMHostRoute.html
Get-VMHostRoute
New-VMHostRoute
Remove-VMHostRoute