New-SCDefaultGateway

New-SCDefaultGateway

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

Syntax

Parameter Set: Automatic
New-SCDefaultGateway -IPAddress <String> [-Automatic] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: ByMetric
New-SCDefaultGateway -IPAddress <String> -Metric <Int32> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed 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.

Parameters

-Automatic

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IPAddress<String>

Specifies an IPv4 or IPv6 address.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Metric<Int32>

Specifies a numerical metric associated with a network gateway.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • DefaultGateway

Examples

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

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.

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

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

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.

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