Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Get hash table of attributes without re-searching
    • Sign In

    • State Not Answered
    • Replies 1 reply
    • Subscribers 66 subscribers
    • Views 504 views
    • Users 0 members are here
    • PWPS
    • customattributes
    • ProjectWise

    Get hash table of attributes without re-searching

    James Ross
    Offline James Ross over 4 years ago

    Hello,

    This might be a feature request...

    Is it possible to get a partial hash table of attributes for an already obtained pw document, without performing a second search using Get-PWDocumentsBySearchWithReturnColumns?

    If possible refreshing the already (unpopulated) CustomAttributes object, if not, just return a hash table?

    If we are moving documents around, renaming, and updating attributes in prior script actions, performing another search just to refresh the CustomAttributes hash table seams a bit of a cludge.

    Being able to do something like this would be nice:

    $myAlreadyFoundPwDoc|Get-PWCustomAttributes -ColumnsToReturn ${"ENV_ATTR1", "ENV_ATTR2"}

    or:

    $aNewHashTbl = Get-PWCustomAttributes -PWdoc $myAlreadyFoundPwDoc -ColumnsToReturn ${"ENV_ATTR1", "ENV_ATTR2"}

    Kind regards, James

    • Sign in to reply
    • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Sun, Jul 28 2019 12:26 PM

      If you get your documents with Get-PWDocumentsBySearch you can include the -GetAttributes option and it will return the attributes in a hash table in the .Attributes property.

      If that's too slow, you can do Get-PWDocumentsBySearch, then filter that down to exactly the files you want, then loop through them and:

      $aNewHashTbl = (Get-PWDocumentsByGUID $myAlreadyFoundPwDoc.DocumentGUID).Attributes

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify 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