File

The File object is of type powerVault File and grants direct access to the Vault file where the Job is triggered on.
The $file object returns the latest iteration of the actual file in Vault.

Syntax

1
$file.'Full Path'

See also

For more informations see: powerVault File.

Remarks

The $file variable is available when a Job is triggered with these parameters:

  • EntityClassId = File

  • EntityId = <Id of the file>

Also the powerJobs Vault addin and the LifecycleEventEditor trigger the Job with this parameters.

Unlike the VDF file object the powerJobs file object has members for things like lifecycle state, category and most importantly properties.
So if you want to know for example the Author of a file you just have to write $file.Author.

You don’t have to care about Ids or file iterations.
You always work with the latest iteration and the powerJobs file object is an exact representation of the file in vault.
This saves a lot of code, because you don’t have to get lifecycle objects or property objects and work through them with loops.

If you have very special use cases, where our commandlets are not flexible enough, you have to use functions from the VDF or directly the webservices. In that case, you can just convert the powerVault file object into an Autodesk file object by using the Id or MasterId property.