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
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
Thanks for the suggestions Brian, that does help get around the issue.
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.