Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Having trouble getting versions to export
    • Sign In

    • State Not Answered
    • Replies 13 replies
    • Subscribers 66 subscribers
    • Views 496 views
    • Users 0 members are here
    • pwps_dab
    • version
    • Export-PWDocuments
    • Get-PWDocumentsBySearch

    Having trouble getting versions to export

    Brian Glaser
    Offline Brian Glaser 8 months ago

    My Get-PWDocumentsBySearch is returning 48 documents, this includes the versions.

    The Export-PWDocuments is only exporting 32 documents and nothing has .verxxxx before the extension. Can anyone explain why?

    PWPS_DAB Version 2.2.0.0.

    Work portion of my script:

    $FilesToExport = Get-PWDocumentsBySearch -FolderPath 'Standards\Test Projects\Test 1\CAD\3D Design Files\Survey' -GetVersionsToo -Verbose
    $Exported = Export-PWDocuments -InputDocuments $FilesToExport -OutputFolder $OutputFolder -ExportVersions -UseDMSFolders

    • Sign in to reply
    • Cancel

    Top Replies

    • MWBSI
      MWBSI Thu, Jan 12 2023 11:02 AM +1
      Using the -verbose switch- with Export-PWDocuments would provide you with more information. Thanks, Mark Weisman | Bentley Systems
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Jan 12 2023 2:12 PM in reply to Brian Glaser +1
      Instead of a suffix is it creating a verXXXX folder under the DMS folder and putting the file, without suffix, in that subfolder? That's how the versions work with DMS folders on the servers?
    • MWBSI
      MWBSI Mon, Feb 13 2023 3:00 PM in reply to Brian Glaser +1
      This will most likely be fixed next release. In the meantime, please investigate using the -ProjectWiseFolder parameter to specify the folder to export documents from rather than using the -InputDocuments…
    • MWBSI
      0 MWBSI Tue, Feb 14 2023 5:58 PM in reply to Robert McMillan

      There are three ways to feed the cmdlet documents: the pipeline, the ProjectWiseFolder paramter and the InputDocuments parameter.   Nothing can be done to speed up the pipeline.   The InputDocuments parameter should server your needs; correct me if  I am wrong.  There will be a new incarnation of Export-PWDocuments released shortly which should improve the exporting of  versions, which was the original subject of this thread.  We will look into speeding up who the cmdlet handles the InputDocuments parameter next go-around..

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert McMillan
      0 Offline Robert McMillan Tue, Feb 14 2023 5:44 PM in reply to MWBSI

      I might have oversimplified the example above to show how it was scanning the entire OutputFolder each time and yes in that example using the folder parameter would improve performance. In my actual script it's exporting documents that match a search criteria not necessarily every document in a folder and the export needs to maintain the ProjectWise folder structure which is why I was using Export-PWDocuments at the document level. 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Tue, Feb 14 2023 10:14 AM in reply to Robert McMillan

      Please trying using the ProjectWise folder parameter rather than the pipeline.  If you use the pipeline, it's like call Export-PWDocuments for each document.  If you have the same performance issues we'll look further into it.

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert McMillan
      0 Offline Robert McMillan Mon, Feb 13 2023 6:22 PM in reply to MWBSI

      Hi Mark,

      We're returning a collection of documents from a search and then passing that through to to the export. In the simplified example below I have two folders, TopLevel and TopLevel\SubFolder each containing 3 documents. In the verbose output you will see for each document it is checking the complete list of files in the OutputFolder not just in the OutputFolder\$($Document.FolderPath) for the document.

      Get-PWDocumentsBySearch -FolderPath 'TopLevel' | Export-PWDocuments -OutputFolder 'C:\export' -UseUnderscores

      VERBOSE: Found 6 documents
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 0 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\doc00003.txt' (Did not exist on disk)
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 1 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\doc00002.txt' (Did not exist on disk)
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 2 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\doc00001.txt' (Did not exist on disk)
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 3 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\SubFolder\doc00006.txt' (Did not exist on disk)
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 4 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\SubFolder\doc00005.txt' (Did not exist on disk)
      VERBOSE: Searching 'C:\export'...
      VERBOSE: Found 5 files in folder 'C:\export'
      VERBOSE: Copied out '\\?\C:\export\TopLevel\SubFolder\doc00004.txt' (Did not exist on disk)

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Mon, Feb 13 2023 5:00 PM in reply to Robert McMillan

      The cmdlet does many different things depending on what parameters are used.  Please provide an example of the command line you are using.

      Mark Weisman | Bentley Systems

      • 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