New-SCDefaultGateway

Creates a default gateway object that is used when creating or modifying static IP address pools.

Syntax

New-SCDefaultGateway [-Automatic] -IPAddress <String> [-VMMServer <ServerConnection>] [<CommonParameters>]
New-SCDefaultGateway -IPAddress <String> -Metric <Int32> [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The New-SCDefaultGateway cmdlet creates a Virtual Machine Manager (VMM) default gateway object that is used when creating or modifying static IP address pools. The default metric is automatic; to change this setting, use the Metric parameter.

Examples

Example 1: Create a default gateway object with an automatically calculated metric

PS C:\> $Gateway = New-SCDefaultGateway -IPAddress 10.0.0.1 -Automatic

This command creates a gateway object with an IP address of 10.0.0.1, automatically computes the metric for the gateway object, and then stores the object in the $Gateway variable.

Example 2: Create a default gateway object and manually set its metric

PS C:\> $Gateway = New-SCDefaultGateway -IPAddress 10.0.1.1 -Metric 10

This command creates a gateway object with an IP address of 10.0.0.1, sets its metric to 10, and then stores the object in the $Gateway variable.

Parameters

-Automatic

Indicates if the metric associated with a network gateway is automatically computed.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPAddress

Specifies an IPv4 or IPv6 address.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Metric

Specifies a numerical metric associated with a network gateway.

Type:Int32
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

DefaultGateway

This cmdlet returns a **DefaultGateway** object.