# Update-VaultItem Updates an Item in Vault and manipulates its associations. ## Syntax ```powershell Update-VaultItem -Number [-NewNumber ] [-Title ] [-Description ] [-Properties ] [-AddAttachments ] [-Attachments ] [-RemoveAttachments ] [] ``` ## Parameters | Type | Name | Description | Optional | |------------|-------------------|-------------------------------------------------------------------------------------------------------------------------|----------| | String | Number | Number of the Item, that should be updated | no | | String | NewNumber | New Number that renames the Item by using the '*Mapped*' Numbering Scheme. This scheme allows entering free item names. | yes | | String | Title | The new title of the Item | yes | | String | Description | The new description of the Item | yes | | Hashtable | Properties | The user-defined properties and their values which should be updated on the Item | yes | | String\[\] | AddAttachments | Full paths to the Vault files that should be attached to the Item | yes | | String\[\] | Attachments | Full paths to the Vault files that will replace the existing attachments of the Item | yes | | String\[\] | RemoveAttachments | Full paths to the Vault files which should be detached from the Item | yes | ## Return type [Item]() ← on success\ **empty** ← on failure ## Remarks In order to update properties of an Item the **-Properties** argument allows updating the values of used-defined properties which can be passed using their: - *system names* are prefided with '\_' and can be used with all Vault language environments (e.g. `@{'_ItemEffectivity' = ...}` ) - *display names* (e.g. `@{'Effectivity' = ...}` can be used with English Vault or `@{'Gültigkeit' = ...}` can be used with german Vault environments). Vault files can be attached to an Item using the **-AddAttachments** parameter, by passing an array of Vault file paths.\ In the same way, all the existing attachment associations can be replaced using the **-Attachments** parameter and individual Vault files can be detached using **-RemoveAttachments**.\ When some existing attachments are checked-out, then powerVault will check-in the *previous file version* of them. :::{warning} You can only make changes to the items you could do with the Vault Client. ::: ## Examples **Rename an Item in Vault:** ```powershell $item = Update-VaultItem -Number '100017' -NewNumber '111111' ``` **Update the details of a Vault Item:** ```powershell $item = Update-VaultItem -Number '100017' ` -Title "FINAL PART" ` -Description "COMBO STAND OFF" ` -Properties @{'Test'='Updated'} ``` **Assign attachments to a Vault Item:** ```powershell $parent = Get-VaultItem -Number 100001 $attachment = Get-VaultFile -File "$/Designs/ABC.ipt" $parentUpdated = Update-VaultItem -Number $parent.Number -Attachments @($attachment.'Full Path') ``` **Detach files from a Vault Item:** ```powershell $item = Get-VaultItem -Number 100001 $attachment = Get-VaultFile -File "$/Designs/ABC.ipt" $itemUpdated = Update-VaultItem -Number $item.Number -RemoveAttachments @($attachment.'Full Path') ``` **Attach a new file to a Vault Item:** ```powershell $item= Get-VaultItem -Number 100001 $attachment= Add-VaultFile -From "C:\Temp\ABC.ipt" -To "$/Designs/ABC.ipt" $itemUpdated = Update-VaultItem -Number $item.Number -AddAttachments @($attachment.'Full Path') ```