[PSADT] Add commands

Insert the pre-defined PSAppDeployToolkit or common PowerShell commands into the deployment script to customize the deployment scenario.

Important

Precondition: Open the PSAppDeployToolkit package in Packag Wrapper (see Open PSAppDeployToolkit).


  1. Go to the Package Designer tab and select the Actions section (e.g. Pre-install, Post-uninstall) that you need to configure.

    Note

    The Repair section is only available from the PSAppDeployToolkit version 3.8.1.

    pkg-wrapper-actions-pre-install

  2. To add a new command (a pre-defined/user-defiend PSAppDeployToolkit or a common PowerShell function), place a cursor in the body of the script where you want to insert it.
    • If you know the command name, start typing it and the IntelliSense will help you to complete the command name, specify its parameters and variables.

      pkg-wrapper-actions-instellisense-commands

    • Alternatively, to view the list of available commands or find a specific one, click Add > Command.

      pkg-wrapper-actions-add-action


      Then select the required command from the list in the dialog box and click Add. This will insert the example code of the command, parsed from the function description. If there are multiple examples, you will be asked which one to insert.

      pkg-wrapper-actions-add-action-dialog

      The Command source presents a list of available PowerShell modules. If you can’t find the PS module you want, wait a moment while it re-reads the available modules and their commands. Use the search box in the upper right corner to filter the list of commands.

      Note

      The list of available PSADT commands is parsed from the opened package (files listed below) and depends on the PSAppDeployToolkit version.

      • \AppDeployToolkit\AppDeployToolkitMain.ps1

      • \AppDeployToolkit\AppDeployToolkitExtensions.ps1


      To quickly insert this command again, use the Recent list of actions and variables.

      pkg-wrapper-actions-add-recent

  3. To save the package, select MENU > Save.

    pkg-wrapper-menu




Note

PACE Suite covers the whole range of application packaging tasks - learn more.

Try PACE Suite for free - 21 days no obligations unlimited trial with all functions unlocked.