I have a folder with 680 documents. There's no sub folders. Two of the files are nearly 1 gig each (but I don't think that should matter).
I've tried both Get-PWDocumentsBySearch (with -slow because I need the custom attributes) and Get-PWDocumentsByGUIDs
It's taking between 5 and 10 min to create the list of files. Is that timeframe normal, and is there a faster way?
Get-PWDocumentsBySearchExtended and its ColumnsToReturn parameter may be of some value to you.
Mark Weisman | Bentley Systems
Answer Verified By: Michael Reilly
Thanks, that's seconds instead of minutes. Still takes a couple on min to update the attributes, but that's bearable.
Can also do something like this to get the documents without the -Slow or -GetAttributes switches and then use the document object method .GetCustomAttributes() to populate the CustomAttributes hash table as needed. That method will populate the CustomProperties of the Document object so there's no need to store it's output and I've piped it to out-null. I find this is nicer if you are using progress dialogs as the delay it broken up and you can see which document it is up to rather than a long wait at the start.
$Documents = Get-PWDocumentsBySearch -FolderPath 'Folder\Path' foreach ($Document in $Documents) { $Document.GetCustomAttributes() | Out-Null }