# Add-RASPubItemPreferredRoute.md

## NAME

Add-RASPubItemPreferredRoute

## SYNOPSIS

Adds a preferred route to the specified published resource.

## SYNTAX

\*\*Add-RASPubItemPreferredRoute \[[Id](#id-string)] *(uint)* -[Name](#name-string) *(string)* -[ReferenceId](#referenceid-string) *(uint)* -[ReferenceType](#ReferenceType) {Gateway | HALB | Custom} \[[Description](#description-string) *(string)*] \[[Enabled](#enabled-string) *(bool)*] \[[SiteId](#siteid-string) *(uint)*] \[*(*[*CommonParameters*](#CommonParameters)*)*]

\*\*Add-RASPubItemPreferredRoute \[-[InputObject](#inputobject)] *(*[*PubItem*](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/types/pubitem.md)*)* -[Name](#name-string) *(string)* -[ReferenceId](#referenceid-string) *(uint)* -[ReferenceType](#ReferenceType) {Gateway | HALB | Custom} \[[Description](#description-string) *(string)*] \[[Enabled](#enabled-string) *(bool)*] \[[SiteId](#siteid-string) *(uint)*] \[*(*[*CommonParameters*](#CommonParameters)*)*]

## DESCRIPTION

This cmdlet allows you to add a preferred route to the specified published resource.

To modify preferred route options, use the Set-RASPubItemPreferredRoute cmdlet.

## PARAMETERS

## Name (string)

The Name of the Preferred Route

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Description (string)

Description of the Preferred Route

```
        Required?                    false

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Enabled (bool)

Whether the Preferred Route is enabled or not

```
        Required?                    false

        Position?                    named

        Default value                True

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## ReferenceType ([RoutingType](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/types/routingtype.md))

Reference Type of the Preferred Route

Possible values: Gateway, HALB, Custom

```
        Required?                    true

        Position?                    named

        Default value                0

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## ReferenceId (uint)

Reference ID of the Preferred Route

```
        Required?                    true

        Position?                    named

        Default value                0

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Id (uint)

Published resource ID.

```
        Required?                    true

        Position?                    0

        Default value                0

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## InputObject ([PubItem](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/types/pubitem.md))

An object specifying the published resource.

To obtain the object, use the Get-PubItem cmdlet.

```
        Required?                    true

        Position?                    0

        Default value                

        Accept pipeline input?       true (ByValue)

        Accept wildcard characters?  false
```

## SiteId (uint)

Site ID.

```
        Required?                    false

        Position?                    named

        Default value                0

        Accept pipeline input?       false

        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 documentation. 
```

## INPUTS

[PubItem](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/types/pubitem.md)

## OUTPUTS

-none-

## EXAMPLES

\*\*---------- EXAMPLE 1 ----------

Add-RASPubItemPreferredRoute -Id 12 -Name Route1 -ReferenceType Gateway -ReferenceId 1

Adds a preferred route with Name Route1 that routes connections through the Gateway with ID 1.

The target published resource is specified by ID 12.\
\*\*---------- EXAMPLE 2 ----------

Add-RASPubItemPreferredRoute -Id 12 -Name Route2 -ReferenceType HALB -ReferenceId 1

Adds a preferred route with Name Route2 that routes connections through the HALB with ID 1.

The target published resource is specified by ID 12.

## RELATED LINKS

* [Get-RASPubItem](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/get-raspubitem.md)
* [Get-RASPubItemPreferredRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/get-raspubitempreferredroute.md)
* [Set-RASPubItemPreferredRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/set-raspubitempreferredroute.md)
* [Remove-RASPubItemPreferredRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/remove-raspubitempreferredroute.md)
* [New-RASCustomRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/new-rascustomroute.md)
* [Get-RASCustomRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/get-rascustomroute.md)
* [Set-RASCustomRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/set-rascustomroute.md)
* [Remove-RASCustomRoute](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/remove-rascustomroute.md)
* [Get-RASGateway](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/get-rasgateway.md)
* [Get-RASHALB](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/get-rashalb.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/commands/add-raspubitempreferredroute.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
