Windows package actions

Use Windows package actions to perform custom operations during package installation. Actions you create in the action interface then get combined into a package that runs a single PowerShell script on targeted devices. Available actions include the following:

  • Copy, rename, delete, or move a file
  • Create or delete a directory
  • Stop, start, or restart a Windows service
  • Add, delete, or update a registry entry
  • Connect or disconnect a UNC share
  • Launch an executable
  • Pop up a window
  • Custom PowerShell commands that you've created. Versions 2021.1 SU2 and newer also support PowerShell Core on Windows devices.

The output of actions are logged and rolled up to the core.

When configuring an action, you can click the Use variable button to insert a variable that is populated with data specific to the device running the action. For more information on variables, see Agent settings: Variables.

Visit the Ivanti Community to see an example of how to configure a software distribution Windows action:

To create a Windows action package
  1. Click Tools > Distribution > Distribution packages.
  2. Right-click the Distribution packages category you want and click New Windows package > Actions.
  3. In the Windows actions properties dialog box Actions page, click Add.
  4. Select the action you want and click OK.
  5. Configure the action properties.
  6. Add and configure other actions if necessary.
  7. Click Save.

Package action PowerShell modules (2019 and newer)

Windows package actions use custom PowerShell modules created by Ivanti. These modules are stored here on the core server:

  • C:\Program Files\LANDesk\ManagementSuite\ldlogon\ivanti-psmodule

Endpoint Manager uses SHA-256 hashes to ensure Ivanti PowerShell module security. When actions run, the action first ensures the module hashes match. If the hashes don't, new modules matching the expected hash are downloaded from the core. If you manually modify an Ivanti PowerShell module, your changes will be overwritten the next time a Windows package action runs.

Because PowerShell modules can conflict with each other, Windows actions force the Ivanti PowerShell modules to load last before executing the Windows package action. This way, if there are PowerShell module conflicts the Ivanti modules will have precedence.

PowerShell Core support was added in version 2021.1 SU2. In the PowerShell action properties dialog box, you can use the PowerShell options page to select which PowerShell edition a device will default to.

Action continue on failure option (2019 SU2 and newer)

Endpoint Manager 2019.1 SU2 adds a Continue on failure option to actions in the Actions list. When selected for an action, if that action fails the remaining actions in the package will still execute. If an action lower in the list then fails without Continue on failure selected, execution will stop.

If you select Continue on failure for all actions in a package, you'll see a warning when saving your changes telling you that "Continuing will cause this package to succeed regardless of success or failure of any individual action." Generally, we recommend that you use the Continue on failure option selectively.

About the reboot action (2019 and newer)

The reboot action has some additional behavior that you may want to be aware of. The reboot action:

  • Logs a system event before initiating the shutdown.
  • Waits a minimum of 30 seconds before initiating the reboot to allow for logging and communication with the core server.
  • If there's a reboot action in a script, the script will resume execution where it left off once the reboot completes. This works even if there are multiple reboots in the action.