Examples/Resources/DefaultGatewayAddress/2-SetDefaultGateway.ps1

<#
    .EXAMPLE
    Set the IPv4 default gateway of the network interface 'Ethernet'
    to '192.168.1.1'.
 
#>

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )

    Import-DscResource -Module NetworkingDsc

    Node $NodeName
    {
        DefaultGatewayAddress SetDefaultGateway
        {
            Address        = '192.168.1.1'
            InterfaceAlias = 'Ethernet'
            AddressFamily  = 'IPv4'
        }
    }
}