< Back

New-NSroute

Sat Jan 11, 2020 12:31 am

NAME New-NSroute



SYNOPSIS

The new-nsroute a new route.





SYNTAX

New-NSroute [-network] <string> [-netmask] <string> [-gateway] <string> [-returnobject <SwitchParameter>]

[-session <nitro_service>] [<CommonParameters>]



New-NSroute [-routeobject] <PSObject[]> [-returnobject <SwitchParameter>] [-session <nitro_service>]

[<CommonParameters>]





DESCRIPTION

Use new-nsroute to create a new route on the NetScaler





PARAMETERS

-session <nitro_service>

This mandatory parameter requires a nitro_service object. This can be requested using the get-nitrosession and

pipelined into this command.



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-network <string>

Specify the network.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-netmask <string>

Specify the subnet mask. The format is 4 octets such as "255.255.255.0"



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-gateway <string>

Specify the gateway



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-routeobject <PSObject[]>

Create a PSObject with following properties: network, netmask, gateway. This parameter will accept an array of

these objects to create in bulk.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-returnobject <SwitchParameter>

If set to true, the object that is created is returned. This is useful to testing purposes.



Required? false

Position? named

Default value False

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

com.citrix.netscaler.nitro.service.nitro_service

This mandatory parameter requires a nitro_service object. This can be requested using the get-nitrosession and

pipelined into this command.



System.String

Specify the network.



System.String

Specify the subnet mask. The format is 4 octets such as "255.255.255.0"



System.String

Specify the gateway



System.Management.Automation.PSObject[]

Create a PSObject with following properties: network, netmask, gateway. This parameter will accept an array of

these objects to create in bulk.



System.Management.Automation.SwitchParameter

If set to true, the object that is created is returned. This is useful to testing purposes.





OUTPUTS

com.citrix.netscaler.nitro.resource.config.network.route





---------- EXAMPLE 1 ----------



new-nsroute -network "0.0.0.0" -netmask "0.0.0.0" -gateway "10.0.1.1"



create a static default route entry

---------- EXAMPLE 2 ----------



new-nsroute -routeobject $routes



Create a route using an object in an array (this allows for bulk import by creating an array of objects).

---------- EXAMPLE 3 ----------



$route = new-nsroute -network "0.0.0.0" -netmask "0.0.0.0" -gateway "10.0.1.1" -returnobject $true



creates a route object, returns the object and stores it in the $route variable.



RELATED LINKS