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…
    • Brian Glaser
      0 Offline Brian Glaser Mon, Feb 13 2023 3:07 PM in reply to MWBSI

      Thanks Mark - I will give this a try

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Mon, Feb 13 2023 4:10 PM in reply to Brian Glaser

      My last post was a little unclear so I took the liberty of correcting it Slight smile   I have done some testing.  The -ProjectWiseFolder parameter will work better than the -InputDocuments parameter, although if you use it with -UseDMSFolders you will get the version suffix appended to the file name, rather than a version folder.  

      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 4:22 PM in reply to Brian Glaser

      If we're making updates to the cmdlet from a performance standpoint can I ask why it's checking the entire OutputFolder for existing files each iteration and not just the target subfolder for the particular document/folder being exported? While we're not talking a massive amount of time per iteration it does stack up when exporting a lot of documents especially if that's to a HDD not a SSD. As an example I'm currently exporting 280,000 documents and I conservatively estimate the increased delay at 1s per file, or 3 days total.

      • 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
    • 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
    <>

    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