Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Export-PWDocuments and missing metadata xlsx file
    • Sign In

    • State Not Answered
    • Replies 12 replies
    • Subscribers 65 subscribers
    • Views 2975 views
    • Users 0 members are here
    • powershell
    • Export-PWDocuments
    • ProjectWise PowerShell Modules

    Export-PWDocuments and missing metadata xlsx file

    Ludovick
    Offline Ludovick over 4 years ago

    Hello,

    I need to export +90.000 files with excel metadata informations .

    I use export-PWDocuments for this (code below)

    When i export small number of files, all is OK, i have the right nulmber of files and an excel file with all metadata & audit trail informations.

    but when i export lot of files (+90.000), i have the right number of files, the powershell script says that the medatada file has been written...but in fact there is no xls file on my disk.

    Copied out 'F:\Export\Suivixxx\171121_Tableau suivixxxxxxxxxxx19\171119 V2.xlsx' (Did not exist on disk)
    Wrote 'f:\metadata2.xlsx' OK

    Is there a size limit of the xls file ?  a limit of number of documents ?  and why the script says that all is ok if it's not the case ?

    extract of script : ( which works like a charm when few files)

    $SecurePassword = ConvertTo-SecureString "$($pass)" -AsPlainText -Force;
    $cnx=Open-PWConnection -DatasourceName $datasource -UserName 'pwadmin' -Password $SecurePassword -admin -ErrorAction SilentlyContinue

    $res=Export-PWDocuments -OutputFolder $DST -ProjectWiseFolder '\xxxxxx_Infra\02-Entrants\Recus\' -ExportVersions
    -ExportMetadata -ExportMetadataFile "f:\metadata2.xlsx"
    $res | Measure-Object
    • Sign in to reply
    • Cancel

    Top Replies

    • Chris Spencer
      Offline Chris Spencer Wed, Mar 27 2019 6:08 AM +1
      Are you using pwps_dab under 64bit PowerShell?
    • Chris Spencer
      0 Offline Chris Spencer Wed, Mar 27 2019 6:08 AM

      Are you using pwps_dab under 64bit PowerShell?

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Ludovick
      0 Offline Ludovick Wed, Mar 27 2019 6:19 AM in reply to Chris Spencer

      no, 32 bits. I can see  that 64 bits version od pwps_dab is available but i can't find PWPS 64 version to do the

      Open-PWConnection

      -

      Ludovick LAGREVOL

      Projectwise Administrator

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Chris Spencer
      0 Offline Chris Spencer Wed, Mar 27 2019 6:31 AM in reply to Ludovick

      Use:

      New-PWLogin and

      Undo-PWLogin

      something like this:

      Import-Module -Name pwps_dab -DisableNameChecking

      $DatasourceName = "??yourdsname??"
      $UserName = "??yourusername??"

      $NALogin = @{
         DatasourceName = $DatasourceName;
         UserName = $UserName;
         Password = Read-Host -Prompt ' Enter password: ' -AsSecureString
      }

      if (New-PWLogin @NALogin) {

            #Your code here....

      }

      Undo-PWLogin

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Ludovick
      0 Offline Ludovick Wed, Mar 27 2019 6:39 AM in reply to Chris Spencer

      thanks i ll try and let you know

      -

      Ludovick LAGREVOL

      Projectwise Administrator

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Ludovick
      0 Offline Ludovick Fri, Mar 29 2019 4:56 AM in reply to Chris Spencer

      Hello, it seems better but...

      An excel file has been generated 17211 KB

      the script ends yesterday with :

      • 'Wrote 'f:\letadata.xlsx' OK
      • End of my export    (a write-host at the end of the script)

      today i try to open excel file but it tells me that powershell use this file and y can't open it

      i close my powershell windows, then i can open in excel but excel says that my file is corrupted and cannot be opened (even partially)

      -

      Ludovick LAGREVOL

      Projectwise Administrator

      • 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