powervault:code_reference:commandlets:update-vaultchangeorder

Update-VaultChangeOrder

Edits a Change Order in Vault and manipulates its associations.

Update-VaultChangeOrder -Number <String> [-DueDate <DateTime>] [-Title <String>] [-Description <String>] [-Properties <Hashtable>] [-AddItemRecords <String[]>] [-ItemRecords <String[]>] [-RemoveItemRecords <String[]>] [-AddAttachments <String[]>] [-Attachments <String[]>] [-RemoveAttachments <String[]>] [<CommonParameters>]

ChangeOrder ← on success
empty ← on failure

Type Name Description Optional
StringNumberNumber of the Change Order that should be editedno
DateTimeDueDate New date and time by which the Change Order must be approved.yes
StringTitleThe new title of the Change Orderyes
String DescriptionThe new description of the Change Orderyes
HashtablePropertiesThe user-defined properties and their values which should be updated on the Change Orderyes
String[]AddItemRecordsVault items - identified by their Number - that should be associated as new Item Records of the Change Orderyes
String[]ItemRecords Vault items - identified by their Number - that will replace the existing Item Records of the Change Orderyes
String[]RemoveItemRecordsVault items - identified by their Number - which should be removed from the Item Records of the Change Orderyes
String[]AddAttachmentsFull paths to the Vault files that should be attached to the Change Orderyes
String[]AttachmentsFull paths to the Vault files that will replace the existing attachments of the Change Orderyes
String[]RemoveAttachmentsFull paths to the Vault files which should be detached from the Change Orderyes

In order to update properties of a Change Order the -Properties argument allows editing the values of used-defined properties which can be passed using their display names.

The -AddItemRecords parameter can be used to add Vault items to a Change Order by passing an array of Vault item numbers.
All the existing Item Records that are part of the change management process can even be replaced using the -ItemRecords parameter and individual Vault item associations can be removed again using the -RemoveItemRecords parameter.

Vault files can be attached to a Change Order 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 or individual Vault files can be detached using -RemoveAttachments.
When some of the attachments are checked-out, then powerVault will attach the previous file version of them.

Edit the details of a previously created Change Order:

$changeOrder = Add-VaultChangeOrder -Number "ECO-000110"

$changeOrderWithUpdatedDetails = Update-VaultChangeOrder -Number $changeOrder._Number
   -DueDate (Get-Date).AddDays(10) 
   -Title "High Welding Frame adaption" 
   -Description "Please copy this design to create a new High Welding Frame.`r`nH = 2100mm`r`nW = 600mm `r`nD = 600mm"
   -Properties @{'Test'= 6.66}

Assign Item Records to a Change Order:

$item = Get-VaultItem -Number '100001'
$allRelatedItemRecords = @($item) + (Get-VaultItemBOM -Number $item.Number)

$changeOrder = Update-VaultChangeOrder -Number 'ECO-0000022' -ItemRecords ($allRelatedItemRecords | Select-Object -ExpandProperty Number) 
$changeOrder.'Number of Items'  #Returns the amount of assigned Item Records

Attach a Markup file to a Change Order

$changeOrder = Update-VaultChangeOrder -Number 'ECO-000138' -AddAttachments @('$/ECO Markup DWF/ECO-000138 Markup coolOrange.dwf')
 
$changeOrder._HasAttachments #Returns True
$changeOrder.'Number of File Attachments' #Returns the amount of attached files