Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Issues when using 'Get-PWDocumentsBySearchExtended' cmdlet
    • Sign In

    • State Verified Answer
    • Replies 3 replies
    • Subscribers 65 subscribers
    • Views 200 views
    • Users 0 members are here
    • pwps_dab
    • Get-PWDocumentsBySearchExtended

    Issues when using 'Get-PWDocumentsBySearchExtended' cmdlet

    Ian Davidson
    Offline Ian Davidson 6 months ago

    I've been trying to use the following code to find documents that have the status of CheckedOut in ProjectWise. Then I would like to find those documents that have been checked out for an extended period of time and (say over 7 days since checkout) and generate a report, but have experienced a few issues.

    # Browse to a folder
        $folder = Show-PWFolderBrowserDialog
    
    # Return Documents that are checked out
        Get-PWDocumentsBySearchExtended -FolderPath $folder.FullPath -Status CheckedOut

    Issues:

    1. Dates for DocumentCheckOutDate and StatusChangeDate are not populating correctly and are showing as "01/01/0001 00:00:00"
    2. This issue with the dates seems to be present within the Get-PWDocumentsBySearch cmdlet also.
    3. Having specified the Status parameter as CheckedOut, it returns documents where the status is either CheckedOut or Exported. (This issue is relatively easy to work around, but included here in case there is an easy solution to fix it within the module).
    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Online Brian Flaherty Tue, Mar 21 2023 7:23 AM +1 verified
      I found that if you use the Get-PWDocumentsByGUIDs or Get-PWDocumentsBySearch with the - Slow switch, the StatusChangeDate will populate correctly. However, the DocumentCheckOutDate never returns the correct…
    • Bill Graefe
      Offline Bill Graefe Tue, Mar 21 2023 11:03 AM in reply to Brian Flaherty +1
      What does return the correct date is Select-PWSQL but the onus is on you write it correctly. It's fast, too, as there is no "slow switch" in SQL (cursors should always be avoided when possible). As correctly…
    Parents
    • Brian Flaherty
      +1 Online Brian Flaherty Tue, Mar 21 2023 7:23 AM

      I found that if you use the Get-PWDocumentsByGUIDs or Get-PWDocumentsBySearch with the -Slow switch, the StatusChangeDate will populate correctly. However, the DocumentCheckOutDate never returns the correct date.

      Answer Verified By: Ian Davidson 

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    • Bill Graefe
      0 Offline Bill Graefe Tue, Mar 21 2023 11:03 AM in reply to Brian Flaherty

      What does return the correct date is Select-PWSQL but the onus is on you write it correctly. It's fast, too, as there is no "slow switch" in SQL (cursors should always be avoided when possible). As correctly mentioned previously, it doesn't automatically consider security (other than who checked something out) unless you write that in too and based on the complexity, I wouldn't begin to try.

      Bill

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Bill Graefe
      0 Offline Bill Graefe Tue, Mar 21 2023 11:03 AM in reply to Brian Flaherty

      What does return the correct date is Select-PWSQL but the onus is on you write it correctly. It's fast, too, as there is no "slow switch" in SQL (cursors should always be avoided when possible). As correctly mentioned previously, it doesn't automatically consider security (other than who checked something out) unless you write that in too and based on the complexity, I wouldn't begin to try.

      Bill

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    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