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…
    Parents
    • MWBSI
      0 MWBSI Thu, Jan 12 2023 11:02 AM

      Using the -verbose switch- with Export-PWDocuments would provide you with more information.

      Thanks,

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Glaser
      0 Offline Brian Glaser Thu, Jan 12 2023 12:05 PM in reply to MWBSI

      I ran with -Verbose out to a text file.

      The following is for one of the files that has versions:

      Found 3 files in folder 'C:\PWOut'
      Copied out '\\?\C:\PWOut\dms01283\Signs_D9-12.dwg' (Did not exist on disk)
      Found 33 files in folder 'C:\PWOut'
      'Standards\Test Projects\Test 1\CAD\3D Design Files\Survey\Signs_D9-12.dwg' is up to date on disk in 'C:\PWOut'.
      Searching 'C:\PWOut'...
      Found 33 files in folder 'C:\PWOut'
      'Standards\Test Projects\Test 1\CAD\3D Design Files\Survey\Signs_D9-12.dwg' is up to date on disk in 'C:\PWOut'.
      Searching 'C:\PWOut'...
      Found 33 files in folder 'C:\PWOut'
      'Standards\Test Projects\Test 1\CAD\3D Design Files\Survey\Signs_D9-12.dwg' is up to date on disk in 'C:\PWOut'.

      It looks like the first time around the script sees that the file doesn't exist and it copies it out.

      Then it appears to skip over it 3 more times for the versions, which all have the same name. Is this because I am using -UseDMSFolders?

      In the Get-Help for Export-PWDocuments, it states that -ExportVersions should append .verXXXX suffix before the extension. Does -ExportVersions need to be used in conjunction with -ExportMetadata to function properly?

      Thanks

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Thu, Jan 12 2023 2:12 PM in reply to Brian Glaser

      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?

       

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Glaser
      0 Offline Brian Glaser Thu, Jan 12 2023 3:40 PM in reply to Kevin van Haaren

      That is what I expected but it is not creating any subfolders. 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Brian Glaser
      0 Offline Brian Glaser Thu, Jan 12 2023 3:40 PM in reply to Kevin van Haaren

      That is what I expected but it is not creating any subfolders. 

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

      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 parameter or sending documents via the  pipeline.  We do recognize the value of supporting pipeline input.

      Sorry for the inconvenience,

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • 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

    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