- Knowledge base
- powerVault
- Troubleshooting
It is not possible to remove a file lifecycle with Update-VaultFile
Issue
Removing a lifecycle definition from a file using powerShell, this is not possible using the Update-VaultFile Commandlet
Solution
To achieve this you can use the Vault API with following code:
$vault.DocumentServiceExtensions.UpdateFileLifeCycleDefinitions(@($file.MasterId), @(<New Lifecycle definition ID>), @(<New State Id>), <string comment>)
No lifecycle definition is the <None> lifecycle in Vault. To access it use 0 for the "new lifecycle definiton ID", this lifecycle is not shown when using
$vault.LifeCycleService.GetAllLifeCycleDefinitions()
For the State Id use -1, this state is also hidden.