Update-PWDocumentAttributes issue

Here is my example attempt at running this command:

Get-PWDocumentsBySearch -FolderPath 'Project Testing\Test Project' | Update-PWDocumentAttributes -Attributes @{Name = $DocRecord.DocumentName; BUILDING = $DocRecord.BUILDING}

It works (good news)...bad news is that for the 'Name' and 'Description' attributes in PW, it add a 5-digit numeric code to the end (I want it to say "Drawing1", but now it says "Drawing100001").  


How can I remove the 00001 from the record?

Kirk

Parents
  • You could use the Rename-PWDocuments cmdlet to do this after each Update-PWDocumentAttributes pass/loop but it may cause major issues if you need to run the update script twice for existing documents. i.e. First time run Drawing100001 document name could be updated to Drawing1 but if run a second time you would end up with a Drawing1 and a Drawing100001 record as the Rename-PWDocuments cmdlet fails. I have confirmed via a testing script that this error occurs.

    It would be much better if the affected cmdlets (of which New-PWDocumentAbstract is also one) worked more like the approach used by the Import-PWDocumentsBySpreadsheet cmdlet that has a VersionIfExists parameter and does not append 00001 etc to the document names etc. was adopted.

    I intend to raise this issue of Drawing100001 naming in the PWPowershell wish list forum as the current implementation is not ideal.

    Answer Verified By: Kirk Peterson 

Reply Children
No Data