PowerShell Script Template Files

AdminStudio 2021 | 21.0 | Application Manager

A PowerShell script template file, Deploy-Application.ps1, is provided in the following location:

   C:\AdminStudio Shared\PowerShellTemplate\

You can customize this script to meet your deployment requirements by editing it in the Windows PowerShell ISE application.

Figure 1:  PowerShell Script Template File, Deploy-Application.ps1, in Windows PowerShell ISE

This script is provided as a template to perform an install or uninstall of an application(s). The script either performs an “install” deployment type or an “uninstall” deployment type. The install deployment type is broken down into three main sections: Pre-Install, Install, and Post-Install. The script refers to the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.

Contents of the PowerShellTemplate Directory

In addition to the Deploy-Application.ps1 template file, the PowerShellTemplate directory also includes these additional files:





Executable that invokes a PowerShell script.


PowerShell script template file which is modified by the Wrap Package Wizard to contain the actual install logic for the specific package, including:

Installer Path

The variable corresponding is $dirFiles variables (toolkit variable found under, AppDeployToolkit\AppDeployToolkitMain.ps1).


The variable corresponding is {appName}


The variable corresponding is {appVersion}


The variable corresponding is {appVendor}


The variable corresponding is {appLang}

Install Command Line

The variable corresponding is {InstallPackage}

Uninstall Command Line

The variable corresponding is {UnInstallPackage}

For example, if Picasa.msi is the package to be wrapped, it's installer path would be: $dirFiles\Picasa.msi


Banner image which can be customized to brand the PowerShell installer.


Image used when the PowerShell installer runs.


Contains configurable preferences for how the toolkit behaves, including language settings.


Script containing your extensions for the framework.


Main script with all functions.


Help file explaining the functions.


Additional functions.

Rules for a Custom PowerShell Template

If you are creating a custom PowerShell template file, observe the following rules:

Do not rename Deploy-Application.ps1—The Deploy-Application.exe application looks for a file named Deploy-Application.ps1. Therefore, if the .ps1 file name is changed to the package name or anything else, the install/uninstallation will fail.
Deploy-Application.ps1 must be in the root folder—The Deploy-Application.exe application expects the Deploy-Application.ps1 file to be present in the root folder level, the same folder that contains the Deploy-Application.exe file.
Installer package must be in the Files folder—The installer package (.msi or .exe) must be in the Files folder.
AppDeployToolkit must be in the root folder—The AppDeployToolkitfolder (along with all of its contents) must be in the root folder.

Note:Installation/uninstallation is not obstructed if the Deploy-Application.exe.config file is not present in the parent folder level or is even deleted.

Note:The $dirFiles variable includes the path to the installer package. If you change the value of this variable, installation will fail.