Update-PWDocumentAttributes Failing

Hi All -

I'm attempting to update a single attribute on 154 files in a particular folder using the "Update-PWDocumentAttributes" cmdlet. I used Brian Flaherty's guide "How To: Update Document Attributes Using PowerShell (powerwisescripting.blog)" to start my cmdlet.

My Powershell variables I set prior to running the actual update cmdlet are:

1. $PWFolder = 'zLibrary\Station Engineering\1. AEP Companies\Ohio\Lundy\Drawings'

2. $PWDocuments = Get-PWDocumentsBySearch -FolderPath $PWFolder -Verbose

3. $Attributes = @{Version='T10076578'}

When I run the cmdlet, I use: Update-PWDocumentAttributes -InputDocuments $PWDocuments -Attributes $Attributes -ReturnBoolean

The return is a failure for each doc captured in the screenshot below.

I used the New-PWLogin -UseGui to log in as an admin with full rights, but can't tell what the issue actually is. I've verified all the files have a property named "Version" by using the cmdlet "($PWDocuments).Version" which returned the value I see in the matching ProjectWise column/field. All files are open for editing (not finalized) and I have permissions to make edits manually on the files directly using ProjectWise.

Parents
  • ,

    This works "on my box":

    $PWFolder = 'dww\VerySimpleEnvTest'
    
    $PWDocuments = Get-PWDocumentsBySearch -FolderPath $PWFolder -Verbose
    
    $Attributes = @{VerySimpleColumn='T10076578'}
    
    $result = Update-PWDocumentAttributes -InputDocuments $PWDocuments -Attributes $Attributes -ReturnBoolean
    

    To troubleshoot, have you tried adding a -Debug parameter to the Update-PWDocumentAttributes Cmdlet?

    The only thing I can think of is that the string for the attribute "Version" is a label, and not the name of the column.  Take a look at the environment attributes in the ProjectWise Administrator and see if the attribute is actually "named" "Version" or if "Version" is a label.

    Dan Williams
    Solution Consultant
    Bentley Systems, Incorporated
    Portland, OR, USA (Pacific Time UTC-08:00)

Reply
  • ,

    This works "on my box":

    $PWFolder = 'dww\VerySimpleEnvTest'
    
    $PWDocuments = Get-PWDocumentsBySearch -FolderPath $PWFolder -Verbose
    
    $Attributes = @{VerySimpleColumn='T10076578'}
    
    $result = Update-PWDocumentAttributes -InputDocuments $PWDocuments -Attributes $Attributes -ReturnBoolean
    

    To troubleshoot, have you tried adding a -Debug parameter to the Update-PWDocumentAttributes Cmdlet?

    The only thing I can think of is that the string for the attribute "Version" is a label, and not the name of the column.  Take a look at the environment attributes in the ProjectWise Administrator and see if the attribute is actually "named" "Version" or if "Version" is a label.

    Dan Williams
    Solution Consultant
    Bentley Systems, Incorporated
    Portland, OR, USA (Pacific Time UTC-08:00)

Children
No Data