Citrix Virtual Apps and Desktops

Generate custom script to install or upgrade VDA via command-line

The Generate custom script button allows you to create a batch or script based on the configuration selections made in the VDA installation UI. The generated script can be exported and used to perform unattended installations or upgrades from the command line. This feature helps automate deployments, ensures configuration accuracy, and reduces manual scripting errors.

Use the following steps to generate the command-line script from the VDA installation UI.

Step 1: Generate a custom script from the installer UI

Note:

This feature is supported only in UI mode.

Configure the VDA installation options in the UI as usual. On the Summary page, select Generate custom script to create a command-line script based on your configuration, as shown in the following screenshot.

New Summary Page

A dialog box appears prompting you to choose a location to save the generated script. You can also select a different directory and rename the script before saving it.

Save as batch

By default, the script is saved as a batch (.bat)file. You can also choose to save it as a PowerShell (.ps1) script.

Save as ps1

After the script is generated and saved, a confirmation dialog appears showing the file location and describing the purpose of the script. You can edit the generated script using any text editor, such as Notepad. Before running the script, exit the installer UI. Only one VDA installation or upgrade process can run at a time.

Save successful

Step 2. Install or upgrade VDA using the generated script

The following screenshot shows how to use the generated batch file to install or upgrade the VDA. The only required parameter is the path to the VDA installer. If the installer path is valid, the script runs the installation or upgrade and exits with the same exit code as the VDA installer. A readable result message is displayed to indicate the outcome of the process.

Run generated batch

The following screenshot shows how to use the generated PowerShell script to install or upgrade the VDA. The only required parameter is the path to the VDA installer. If the installer path is valid, the script runs the installation or upgrade and exits with the same exit code as the VDA installer. A readable status message appears, indicating the result of the process.

Run Generated PS1

Note:

If the Delivery Controller is configured with an enrollment token, run the script as shown in the following screenshot.

Script with Web Socket token

The script requires the following parameters: <Path-to-generated-script>, <Path-to-vda-installer>, <Websocket-token-value>.

Generate custom script to install or upgrade VDA via command-line