For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate Application Content Items

Using PowerShell is a convenient way to automate the creation of application content items and save time compared with using the dashboard. Creating content items with PowerShell involves several steps: first, create the content item shell, then create a version within it. Note that this is different from importing a content item exported from another DeployR server: this creates a completely new content item from scratch.

You will use several DeployR functions:

  • Get-DeployRApplication

  • New-DeployRContentItem

  • New-DeployRContentItemVersion

This example creates a 7-Zip application content item. I have downloaded the 7-Zip MSI to my source folder. I will define the MSI path and installation command line as variables. First, create the content item shell. Once it is created, it appears in the dashboard.

Note: any time you use the DeployR functions, you need to import the module and connect to DeployR, as described on the Scripting for DeployR Server page.

$AppName = '7zip'
$NewDRCI = New-DeployRContentItem -Type Folder -Name $AppName -Description "Script Generated" -Purpose Application

After creating the content item shell, populate the version with the following details:

$AppSourceFolder = 'D:\DeployRSources\Applications\7-Zip\26.00'
$AppDescription = '26.00'
$InstallationCommandLine = 'msiexec.exe /i "7z2600-x64.msi" /quiet /norestart'
New-DeployRContentItemVersion -ContentItemId $NewDRCI.id -SourceFolder $AppSourceFolder -InstallationCommandLine $InstallationCommandLine -Description $AppDescription

Overall, it is pretty straightforward to create an Application Content Item in DeployR. Once you know the basics, you can do more. I have created several functions to simplify automation of generating these applications. These functions are:

  • New-DeployRApp

    • This is used for creating a brand new app

  • Test-DeployRAppExists

    • Used in automation to check whether an app you are about to generate already exists.

  • Update-DeployRApp

    • Used to update an app already in DeployR by adding a new version

With these functions, I have automated creating and updating several applications in my DeployR lab. The full script is on the 2Pint Software GitHub: https://github.com/2pintsoftware/2Pint-DeployR/blob/main/Automation/Generate-AppContentItems.ps1

Last updated