New-SCDefaultGateway
Creates a default gateway object that is used when creating or modifying static IP address pools.
Syntax
New-SCDefaultGateway
[-VMMServer <ServerConnection>]
-IPAddress <String>
[-Automatic]
[<CommonParameters>]
New-SCDefaultGateway
[-VMMServer <ServerConnection>]
-IPAddress <String>
-Metric <Int32>
[<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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IPAddress
Specifies an IPv4 or IPv6 address.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Metric
Specifies a numerical metric associated with a network gateway.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
Specifies a VMM server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
DefaultGateway
This cmdlet returns a DefaultGateway object.