[PSADT] Use code snippets

Code snippets are small blocks of reusable code. Save your often used code to a snippet and insert it where and as many times as you need. You can use code snippets to save any piece of code of any size. You can configure Package Wrapper to use either your personal or team’s code snippets.

Important

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



Save code to snippet

  1. Go to the Package Designer tab and open the Actions section that contains a code you want to save to a snippet.

    pkg-wrapper-actions-install

  2. Select the code block and then invoke Save to snippet from the context menu.

    pkg-wrapper-actions-save-to-snippet

  3. Enter a snippet name, description and click Save.

    pkg-wrapper-actions-create-snippet


Insert code from snippet

  1. Go to the Package Designer tab and select the Actions section (e.g. Pre-install, Post-uninstall) where you want to insert a code from the snippet.

    pkg-wrapper-actions-pre-install

  2. Click Add > Snippet in the toolbox menu.

    pkg-wrapper-actions-add-snippet

  3. Select the needed snippet from the list and click Add.

    Use the search box to find the snippet by a name. Hover the mouse pointer over the ‘code’ icon to view the code body in the tooltip.

    pkg-wrapper-actions-snippets-list


Edit, delete snippet

  1. Go to the snippets settings. For this, click MENU > Settings.

    pkg-wrapper-menu

  2. Switch to the Snippets tab.

    Here you can manually create new, edit existing, and delete snippets using the Add, Edit, Delete buttons.

    To share the snippets with your team, select a common network folder in the Snippets location field.

    pkg-wrapper-menu-snippets




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.