Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Find out when a workarea is updated
    • Sign In

    • State Not Answered
    • Replies 7 replies
    • Subscribers 67 subscribers
    • Views 542 views
    • Users 0 members are here
    • Update
    • workarea

    Find out when a workarea is updated

    Michel-Ange Doubogan
    Offline Michel-Ange Doubogan 11 months ago

    Hi everyone,

    Does the workarea property 'updatedatetime' indicate if a file or a folder in a workarea is updated? I'm trying to find out if any file or folder in a workarea is updated. How can i catch this behaviour?

    Thanks.

    • Sign in to reply
    • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Sep 26 2022 1:07 PM

      Are you talking about a property under the Properties tab when you right-click the root folder a Work Area, Select Properties and then click the Properties tab? If so all those properties are attributes created by the ProjectWise admin and (unless they've done some backed database magic) don't update automatically.

      If you're talking about the UpdateDateTime of just the general Folder properties (the UpdateDateTime property returned by Get-PWFolders cmdlet) as near as I can figure the only thing that causes that property to update is changing one of the properties on that folder (Description, a work area property, etc...). Adding/modifying/deleteing files or folders inside that folder does not update it.

      There is a cmdlet Get-PWFolderTreeMaxFileUpdateDate that looks like it should return this info but in my testing it seems wrong? I tested it on a folder where I had updated files today and it's returning a date over a year old.

      Get-PWRichProjectMaxUpdateDate also seems like it should do it, but I'm not exactly sure how that operates. I pass it a folder path to a richproject and returns info for every rich project in the datasource (the dates actually look correct to me though, unlike the other one).

      If you want to write your own:

      $pwDocs = Get-PWDocumentsBySearch -FolderPath 'path\to\folder'
      $latest = ($pwDocs | Sort -Descending DocumentUpdateDate | Select-Object -First 1).DocumentUpdateDate

      That will probably be slow and suck up a ton of memory for really large folder structures. although, hmmm, not sure this'll be faster but should free up the memory quicker:

      $latest = (Get-PWDocumentsBySearch -FolderPath 'path\to\folder').DocumentUpdateDate | Sort -Descending | Select -First 1
      

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Michel-Ange Doubogan
      0 Offline Michel-Ange Doubogan Mon, Sep 26 2022 1:47 PM in reply to Kevin van Haaren

      Thank you Kevin i find your respond very helpful. So there is no cmdlet in powershell which indicate if an attribute of a work area has been updated?

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Sep 26 2022 3:52 PM in reply to Michel-Ange Doubogan

      Oh, hmmm, I'm not seeing a way to tell when one of the Work Area properties is updated. It appears UpdateDateTime only updates when any of the non-WorkArea properties is changed. Perhaps someone else is aware of a way.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Michel-Ange Doubogan
      0 Offline Michel-Ange Doubogan Tue, Sep 27 2022 1:25 PM in reply to Kevin van Haaren

      Alright thank you Kevin

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Dave Cole
      0 Offline Dave Cole Thu, Oct 6 2022 1:14 PM in reply to Michel-Ange Doubogan

      The best I came up with using SSMS to tell if an attribute of a work area has been updated is:

      SELECT * FROM sys.tables
      WHERE [name] like '%'
      ORDER BY [modify_date] desc

      Replace % with the table name of your Work Area.

      It doesn't tell you what was updated just that something was. Not very helpful. I also don't see anything in the audit trail when a WA attribute is updated.

      • 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