Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum edit new document attribute values on adding new document
    • Sign In

    • State Verified Answer
    • Replies 4 replies
    • Answers 2 answers
    • Subscribers 65 subscribers
    • Views 2121 views
    • Users 0 members are here
    • attribute
    • powershell
    • values
    • new document

    edit new document attribute values on adding new document

    Kevin
    Offline Kevin over 6 years ago

    With powershell ISE I can add a new document and pass the result to a variable:

    $var1 = New-PWDocument -FilePath "valid file path" -FolderPath "valid PW folder path"

    How do I issue values to the attributes?

    maybe something like this?

    $var1.Attributes.Item("att_Keywords").value =

    Thx for your patience.

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin
      Offline Kevin Mon, Jul 17 2017 6:13 AM +1 verified
      oops that was toooo easy ... *blush* $var1 = New-PWDocument -FilePath "valid file path" -FolderPath "valid PW folder path" Update-PWDocumentAttributes -InputDocuments $var1 -Attributes @{attname…
    • Kevin
      +1 Offline Kevin Mon, Jul 17 2017 6:13 AM

      oops that was toooo easy ...  *blush*

      $var1 = New-PWDocument -FilePath "valid file path" -FolderPath "valid PW folder path"

      Update-PWDocumentAttributes -InputDocuments $var1 -Attributes @{attname= 'value'}

      Answer Verified By: Kevin 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Mon, Jul 24 2017 7:47 AM in reply to Kevin

      Kevin answered his own question. 8^}

      Setting as answered.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Kirk Peterson
      0 Offline Kirk Peterson Tue, Dec 19 2017 5:20 PM in reply to Kevin

      How do you pull the values back out of PW once you write the custom attribute?  I have tried this, but get an error:

      $PW_Doc = Get-PWDocumentsBySearch -FolderPath $PWFolderToImportInto -JustThisFolder -DocumentName $DT_Svr[$LoopCount].Name -GetAttributes -ErrorAction Stop

      $PWDate=$PW_Doc.CustomAttributes("A360_WriteDate") ((also .Attribute(@{A360_WriteDate}))

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kirk Peterson
      0 Offline Kirk Peterson Tue, Dec 19 2017 5:38 PM in reply to Kirk Peterson

      this worked 

      $PWDate=$PW_Doc.CustomAttributes['A360_WriteDate']

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies