Script Collections

Overview

Script Collections in Hydra provide a centralized way to organize, manage, and execute scripts across your environments. Instead of attaching individual scripts to each workflow or resource, collections allow you to group scripts and actions and reuse them consistently at scale.

A Script Collection can contain one or more scripts designed for a specific purpose, such as application installation, system configuration, optimization, or cleanup. With over 40 actions to choose, Script Collections enable you to create very powerful task sequences, resulting in streamlined image creations and new session host rollouts.

Creating a Script Collection

  1. In the left-side menu from the main Dashboard, click Scripts and Collections and then Collections.

Frame 1409.png

Hydra has several built-in Collections ready for use. For example, Collections that can Install Windows Updates.

Frame 1410.png
  1. Click the Show Details button to open the Code pane and review the 1st Template Script Collection. This is meant to be cloned and modified, so there isn’t much information here.

Frame 1411.png
  1. After reviewing, click the Copy Script Collection button.

Frame 1412.png

By default, the name of the cloned script will be Builtin: 1st Template Script – Copy. Also, the Script Collection will be added to the bottom of the table.

Frame 1413.png
  1. Click the Collection name, e.g., Builtin: 1st Template Script Collection – Copy, and input the desired name. The Collections table has a search bar, so consider using a naming convention to group scripts based on what they do, or where they run.

    1. Optionally, add a Description with an overview of the Collection’s purpose, workflow, and error-handling.

Frame 1414.png

Modifying a Script Collection

Once a Collection has been cloned, there is an inevitable configuration. For each added Action in the Collection, there are a few options:

  1. Click the Show details button to open the Parameters field:

Frame 1415.png
  1. Click the Add button to add a new script or action.

Frame 1416.png
  1. Click the Delete button of a given step to remove that step.

Frame 1417.png
  1. Click the Down (or Up) arrow to move a step down (Up) in the sequence.

Frame 1418.png

Performing Action on Script Collection Error

Hydra has built-in error handling for Script Collections. To configure an Action or Script to trigger On Error:

  1. Underneath the Actions and Scripts section of the Collection, find the On Error – Actions and Scripts section

  2. Click the Add button.

Frame 1419.png
  1. Choose an appropriate Action or Script to execute On Error. Here are a few built-in examples: Run a Custom or Built-in Script, VM – Start, VM – Deallocate, VM – Delete.

Below is a basic example of the Script Collection configuration:

Frame 1420.png

Parameters

Certain Script Collection actions have special parameters that can be utilized, and some even require them. For example, the VM Disk - Resize action requires a resize amount to be specified. Select the first icon on the right side to show the Parameters text box, and then specify the parameter:

Frame 1976.png

Scripts can also utilize these parameters. This can be useful to maintain the same parent script, but then utilize different Script Collections for parameter adjustments. You would simply add a param section at the top of the PowerShell script with the data type, like below:

param(

  [string] $Mode,
  
  [bool] $DoNotRestart = $false,
  
  [string] $LogDir = "$env:windir\system32\logfiles"

)

In the Parameters box for the Script action in the Script Collection, you can then specify the parameters:

Frame 1975.png

Installing WinGet Applications

Hydra enables applications to be installed directly through WinGet, or Windows Package Manager. This negates the need to utilize a PowerShell script for installing applications available through WinGet. To add WinGet application installs to a Script Collection, choose the PM - Install Apps action and select the Select Packages button, represented by the paper plane icon:

image-20260403-142634.png

Accept the terms and search for any packages you wish to install via WinGet. The selected packages will appear on the right and will install in top-down order. You can utilize the arrows to rearrange as necessary. Select OK to be taken back to the Script Collections page. Don’t forget to save your Script Collection once you are finished.

image-20260403-143247.png

Don’t forget to save your Script Collection once you are finished.

image-20260403-143402.png

Updating WinGet Applications

You can also add the PM - Update Apps action to update any applications available via WinGet. By default, all WinGet-compatible apps are updated. If you wish to selectively update the apps, select the Details button and type the comma-separate application IDs in the parameters field. Note the ID is different than the name.

image-20260403-143837.png