New-SCDefaultGateway
Creates a default gateway object that is used when creating or modifying static IP address pools.
Syntax
Automatic (Default)
New-SCDefaultGateway
-IPAddress <String>
[-VMMServer <ServerConnection>]
[-Automatic]
[<CommonParameters>]
ByMetric
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.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Automatic
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-IPAddress
Specifies an IPv4 or IPv6 address.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Metric
Specifies a numerical metric associated with a network gateway.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByMetric
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a VMM server object.
Parameter properties
Type: | ServerConnection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Outputs
DefaultGateway
This cmdlet returns a DefaultGateway object.