Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Is it possible to get the file content of a document on PW?
    • Sign In

    • State Not Answered
    • Replies 4 replies
    • Subscribers 65 subscribers
    • Views 694 views
    • Users 0 members are here
    • powershell
    • ProjectWise
    • pwps_dab

    Is it possible to get the file content of a document on PW?

    Tom Denby
    Offline Tom Denby over 2 years ago

     i would like to pass it into a variable so that i can then create an instance of that file on AWS. i want to do this with out downloading the file for a local folder.. i have managed to do this on most systems but im new to powershell for projectwise. any help would be great. 

    further to my previous post..i have figured out how to get the content but it is corrupt when i open it so im guessing the content type is being ignored or the file secure and when exported needs to be decoded maybe.. 

    # Login details to use the web API
    $Text = "USERNAME:PASSWORD"
    $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text)
    $EncodedText =[Convert]::ToBase64String($Bytes)
    $authVal = "Basic " + $EncodedText
    
    # URL to get the file content 
    $uri = "FILE Path" 
    
    $PW_Cont = Invoke-WebRequest -Method Get -Uri $uri -Headers @{Authorization = $authVal} -ContentType "application/octet-stream; charset=utf-8" 
    

    • Sign in to reply
    • Cancel
    • Chris Andrew
      0 Offline Chris Andrew Sat, Nov 28 2020 6:05 AM

      Not sure about powershell but you can with the power automate connector. There is also a connector in power automate for Aws. But I've never used it

      Regards

      Chris


      AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead

      Associate Director – Digital

      OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12

      Civil 3D 2023 | Dynamo | Navisworks Manage

      PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio

      Speckle | BIMVision | Revizto | Solibri

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Tom Denby
      0 Offline Tom Denby Sun, Nov 29 2020 5:11 PM in reply to Chris Andrew

      thanks for letting me know you can do it in Powerautomate. if all else fails i might have to use that method.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Mon, Nov 30 2020 9:46 AM

      I am not aware of any way to get the contents of a file without downloading it to the working directory or another local folder. At least not with PowerShell.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Chris Andrew
      0 Offline Chris Andrew Mon, Nov 30 2020 12:47 PM in reply to Tom Denby

      You might be able to use PowerAutomate desktop to combine PowerAutomate and your powershell script

      Regards

      Chris


      AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead

      Associate Director – Digital

      OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12

      Civil 3D 2023 | Dynamo | Navisworks Manage

      PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio

      Speckle | BIMVision | Revizto | Solibri

      • 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