Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Export-PWDocuments script crashes Powershell
    • Sign In

    • State Not Answered
    • Replies 3 replies
    • Subscribers 65 subscribers
    • Views 200 views
    • Users 0 members are here
    • Folders
    • powershell
    • Export
    • crash
    • powershellscripting
    • metadata
    • Export-PWDocuments

    Export-PWDocuments script crashes Powershell

    PM68
    Offline PM68 6 months ago

    Hi All,

    I was given the following script from Bentley to allow me to export a fair amount of data from our datasource which will be backed up somewhere (somebody else will be looking after that). For now I just want to copy out the files.

    The command given to me is:

    Export-PWDocuments -OutputFolder "E:\temp\export" -ProjectWiseFolder "ARCHIVE\" -ExportMetadata -ExportMetadataFile "C:\temp\excel\output1.xlsx"

    It works well except it only gets about halfway through the export and crashes Powershell. I am not a Powershell user but I am learning a lot through this issue, but I am not sure what else to do. What is written to the Windows logs is just an error code for the crash.

    There are lot of folders that go down many levels so that may be the problem but that is only my guess and I don't know how to work around that.

    For further info I am running it elevated in the  x86 version of the Windows Powershell.

    Thanks for reading.

    • Sign in to reply
    • Cancel

    Top Replies

    • MWBSI
      MWBSI Wed, Mar 8 2023 8:50 AM +1
      Please use the -verbose switch. Please post the lines leading up to the error and then the error messages. Also you could try the same command line in 64-bit PowerShell. Mark Weisman | Bentley Syste…
    Parents
    • MWBSI
      0 MWBSI Wed, Mar 8 2023 8:50 AM

      Please use the -verbose switch.  Please post the lines leading up to the error and then the error messages.   Also you could try the same command line in 64-bit PowerShell.

      Mark Weisman | Bentley Systems

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • PM68
      0 Offline PM68 Wed, Apr 12 2023 7:46 PM in reply to MWBSI

      Hi. I am now using 64bit powershell and it will run for a long time and then crash out at some point and never creates the metada file. I know there are more files in there that should be being exported. Where should I be looking for the error messages? Thanks

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • MWBSI
      0 MWBSI Thu, Apr 13 2023 3:43 PM in reply to PM68

      Did you add the -verbose switch to the command line, Ie use 

      export-PWDocuments -OutputFolder "E:\temp\export" -ProjectWiseFolder "ARCHIVE\" -ExportMetadata -ExportMetadataFile "C:\temp\excel\output1.xlsx" -verbose

      Did you see any messages after this?  If so, please post them back.

      You could also verify that:

      - You logged in to your datasource with New-PWLogin and saw the messages

      Security Protocol now set to TLS 1.2
      PWPS_DAB Version is 23.1.1.0
      This is a 64-bit process.
      .Net Framework version OK (at least 4.8)

      before being presented with the login dialog box.

      - You have the Visual Studio 2022 runtimes installed

      Export-PWDocuments works with simpler data and without the ExportMetadata related parameters

      Hope this helps,

      Mark Weisman | Bentley Systems 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • MWBSI
      0 MWBSI Thu, Apr 13 2023 3:43 PM in reply to PM68

      Did you add the -verbose switch to the command line, Ie use 

      export-PWDocuments -OutputFolder "E:\temp\export" -ProjectWiseFolder "ARCHIVE\" -ExportMetadata -ExportMetadataFile "C:\temp\excel\output1.xlsx" -verbose

      Did you see any messages after this?  If so, please post them back.

      You could also verify that:

      - You logged in to your datasource with New-PWLogin and saw the messages

      Security Protocol now set to TLS 1.2
      PWPS_DAB Version is 23.1.1.0
      This is a 64-bit process.
      .Net Framework version OK (at least 4.8)

      before being presented with the login dialog box.

      - You have the Visual Studio 2022 runtimes installed

      Export-PWDocuments works with simpler data and without the ExportMetadata related parameters

      Hope this helps,

      Mark Weisman | Bentley Systems 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    No Data

    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