Getting started

In order to get started either open any powershell IDE or open the powerEvents ISE shortcut in the start menu, which already opens one of our sample event scripts for you.
Import the Module by calling Import-Module powerEvents.

The product is delivered with a couple of sample scripts located in %PROGRAMDATA%\coolOrange\powerEvents\Events which can also be used as templates for new event scripts.

This sample script registers to the UpdateFileStates event which is triggered when a file changes its lifecycle state.
In our example we make use of the Restrictions and the Post event:

  • Restrictions: In the Restrictions event we check if the file state is about to be changed to a release state and/or if the job isn't already added to the job queue.
    The user has to have at least the roles Document Consumer and Document Editor Level 1 in order to read / write the Job-Queue.
    If one of the checks fail, a restriction will be set.
  • Post: When in this event the state was successfully changed to “Released”, a job of type “Autodesk.Vault.DWF.Create.<File extension>” for the file will be added to the job queue.

Only files with following extensions .iam, .idw, .dwg (AutoCAD and Inventor), .ipn, .ipt are handled as only these are supported by the vault DWF jobs.


The script can be tested by doing the following steps:

  1. Open Vault client
  2. Go to to a file where the lifecycle state can be changed to Released and is of one of the supported types.
  3. Change the state to Released.
  4. Open the job queue.
  5. The job contains a DWF job for the change file.

Out of the box the event registration for this script is disabled, therefore you have to enable it by un-commenting the following lines:

#Register-VaultEvent -EventName UpdateFileStates_Restrictions ...
#Register-VaultEvent -EventName UpdateFileStates_Post ...

This sample script registers to the UpdateStates events for all entity types: File, Item, CustomEntity and ChangeOrder. The event is triggered when the lifecylce state of an entity is changed.
In our example we make use of the Restrictions event:

  • Restrictions: In the Restrictions event we check if the state is about to be changed to Released or in case of a ChangeOrder to Closed.
    We also check if the user who is changing the state is the same who last modified the entity. If one of these rules is violated a restriction will be set.

The script can be tested by doing the following steps:

  1. Open Vault client
  2. Goto to an entity (e.g Item, File, CustomEntity) which lifecycle state is changeable to Released but was last modified by another vault user.
  3. Change the state to Released.
  4. A restriction dialog will appear telling you that state can't be change by another user.

In the default delivery the event registration for this script is disabled, therefore you will have to enable it by uncommenting following lines:

#Register-VaultEvent -EventName UpdateFileStates_Restrictions ...
#Register-VaultEvent -EventName UpdateItemStates_Restrictions ...
#Register-VaultEvent -EventName UpdateCustomEntityStates_Restrictions ...
#Register-VaultEvent -EventName UpdateChangeOrderState_Restrictions ...


powerEvents is a IWebServiceExtension which means that it will be loaded in every application that uses the Autodesk.Connectivity.WebServices.dll, below are some examples:


Changes made in the powershell files located in the Events or Modules folder are loaded by powerEvents at every start.

When the files are modified while they are loaded, powerEvents automatically reloads them!
Restarting your application is therefore not required.

Adding or removing Event scripts or Modules also causes powerEvents to automatically reload the whole configuration.
Keep this functionality in mind, when developing new Events or when saving changes in your powerShell IDE.
All your scripts and module will be executed again in all running applications that are using powerEvents.

In order to disable the automatic script reloading you need to set the global flag powerEvents_ReloadPsScripts to False.
By default you can find this flag in the %PROGRAMDATA%/coolorange/powerEvents/Common.psm1 module:

$global:powerEvents_ReloadPsScripts = $false
When disabled and the functionality is activated, you need to restart the application.

The Common.psm1 module also provides a $processName variable which is available in the event scripts.
The variable contains the name of the process where the script is currently executed.