Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum How do I update a single document using powershell?
    • Sign In

    • State Verified Answer
    • +2 person also asked this people also asked this
    • Replies 8 replies
    • Subscribers 66 subscribers
    • Views 3619 views
    • Users 0 members are here

    How do I update a single document using powershell?

    Bill Leddy
    Offline Bill Leddy over 5 years ago

    I am currently using import-pwdocuments to replace an existing document in projectwise with an updated document from a local disk. When the command executes, it displays some disturbing messages about deleting other files and subfolders from Projectwise because they are not found on disk.  The files are not really deleted.  I am not using the -MakeProjectwiseMatchDisk switch.  I do not see a way to block recursive action thru subfolders.

    Is there another cmdlet that is more appropriate for bringing in a single file? (I'm new to the ProjectWise extensions. maybe I missed something?)

    Is there a way to suppress the totally inaccurate message?  (I will be turning this script over to an end-user.)

    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Offline Brian Flaherty Thu, Jan 25 2018 10:29 AM +1 verified
      I have made changes to the Update-PWDocumentFile cmdlet. This should do what you are needing. See Get-Help Update-PWDocumentFile -Full This should be available in the next release of the PWPS_DAB module…
    Parents
    • Brian Flaherty
      0 Offline Brian Flaherty Wed, Jan 24 2018 2:22 PM

      Have you tried Update-PWDocumentFile? 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Brian Flaherty
      0 Offline Brian Flaherty Wed, Jan 24 2018 2:22 PM

      Have you tried Update-PWDocumentFile? 

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Bill Leddy
      0 Offline Bill Leddy Wed, Jan 24 2018 3:17 PM in reply to Brian Flaherty

      The documentation for this cmdlet is a little sketchy.  It appears to me that this cmdlet takes documents from Projectwise as input and replaces the files on the local disk.  I want to go the other direction.

      However, you got me thinking: maybe I should try a checkout/checkin combination.   I didn't consider checkout previously because the document is completely rebuilt from other files and a copy of the file from projectwise is not required.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Bill Leddy
      0 Offline Bill Leddy Wed, Jan 24 2018 4:43 PM in reply to Bill Leddy

      Using CheckOut/CheckIn successfully avoids the "deleting subfolders" message, but it also removes the local copy.  Obviously, you can copy the file to another location before check-in if you need to retain a local copy.    

      Check-out cmdlet: CheckOut-PWDocuments (don't use the -CopyOut switch)

      Check-in cmdlet: CheckIn-PwDocumentsOrFree

      • 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