> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-powershell-api-guide/v20/examples/vdi.md).

# VDI Example

## Parallels RAS PowerShell - VDI Example

\#Establish a connection with Parallels RAS (Replace Administrator with\
your RAS root account).\
[New-RASSession](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASSession) Administrator

\###### FARM CONFIGURATION ######

\#Add a Provider. $Provider =[New-RASProvider](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASProvider) -Server\
"vdi.company.dom" -VMwareESXi -VmwareESXiVersion v6\_5 -VDIUsername root\
-VDIAgent"vdiagent.company.do" -Username root

\#Apply settings, for the Publishing Agent to connect with the new\
Provider. [Invoke-RASApply](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Invoke-RASApply)

\#Get the list of Virtual Machines through the RAS Provider Agent[Get-RASVM](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Get-RASVM) -ProviderId $Provider.Id

```
    Name             State    ID                                       Host ID  Site ID
    ----             -----    --                                       -------  -------
    Windows 8        On       564d5e6f-3fad-bcf9-7c6b-bac9f212713d     1        1
                        
```

\#Create a new VDI Template (Guest Automatically Installed) $vmTemplate\
\= [New-RASVDITemplate](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASVDITemplate)\
-Provider $Provider.Id -VMId 564d5e6f-3fad-bcf9-7c6b-bac9f212713d -Name\
Win10template -VMNameFormat Win10-%ID:3% -MaxVMs 5 -PreCreatedVMs 2\
-ImagePrepTool RASPrep -OwnerName Owner -Organization Parallels -Domain\
company.dom -Administrator Administrator -CloneMethod LinkedClone\
-TargetOU "OU=VDI,DC=dom,DC=company"

\#Add a VDI Pool $VDIPool =[New-RASVDIPool](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASVDIPool) -Name "VDIPool"

\#Add a VDI Pool Member[Add-RASVDIPoolMember](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Add-RASVDIPoolMember)\
-VDIPoolId $VDIPool.Id -Type TEMPLATEGUEST -Name $vmTemplate.Name\
-VDITemplateId $vmTemplate.Id

\###### PUBLISHING CONFIGURATION ######

\#Add published desktop making use of the VDI Template.\
[New-RASPubVDIDesktop](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#New-RASPubVDIDesktop)\
-Name VDIDesktop -ConnectTo SpecificRASTemplate -VDITemplate\
$vmTemplate -Persistent $true

\#Apply all settings. This cmdlet performs the same action as the Apply\
button in the RAS console.\
[Invoke-RASApply](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Invoke-RASApply)

\#End the current RAS session.\
[Remove-RASSession](/landing/ras-powershell-api-guide/v20/parallels-ras-powershell-admin-module/index.md#Remove-RASSession)

© 2025 Parallels International GmbH. Parallels and the Parallels logo\
are trademarks or registered trademarks of Parallels International GmbH\
in Canada, the U.S., and/or elsewhere.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.parallels.com/landing/ras-powershell-api-guide/v20/examples/vdi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
