PowerShell Script Template Files
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.

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:
| File | Description |
|---|---|
| Deploy-Application.exe Deploy-Application.exe.config | Executable that invokes a PowerShell script. |
| Deploy-Application.ps1 | 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). Name The variable corresponding is {appName} Version The variable corresponding is {appVersion} Manufacturer The variable corresponding is {appVendor} Language 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 |
| AppDeployToolkit\AppDeployToolkitBanner.png | Banner image which can be customized to brand the PowerShell installer. |
| AppDeployToolkit\AppDeployToolkitLogo.ico | Image used when the PowerShell installer runs. |
| AppDeployToolkit\AppDeployToolkitConfig.xml | Contains configurable preferences for how the toolkit behaves, including language settings. |
| AppDeployToolkit\AppDeployToolkitExtensions.ps1 | Script containing your extensions for the framework. |
| AppDeployToolkit\AppDeployToolkitMain.ps1 | Main script with all functions. |
| AppDeployToolkit\AppDeployToolkitHelp.ps1 | Help file explaining the functions. |
| AppDeployToolkit\AppDeployToolkitMain.cs | 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.exeapplication looks for a file namedDeploy-Application.ps1. Therefore, if the.ps1file 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.exeapplication expects theDeploy-Application.ps1file to be present in the root folder level, the same folder that contains theDeploy-Application.exefile. -
Installer package must be in the Files folder—The installer package (
.msior.exe) must be in theFilesfolder. -
AppDeployToolkit must be in the root folder—The
AppDeployToolkitfolder (along with all of its contents) must be in the root folder.noteInstallation/uninstallation is not obstructed if the
Deploy-Application.exe.configfile is not present in the parent folder level or is even deleted. The$dirFilesvariable includes the path to the installer package. If you change the value of this variable, installation will fail.