Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Change the rendition profile on several folders with the same name at once with Set-PWFolderRenditionProfile?
    • Sign In

    • State Verified Answer
    • Replies 6 replies
    • Answers 1 answer
    • Subscribers 67 subscribers
    • Views 1923 views
    • Users 0 members are here
    • powershell
    • Set-PWFolderRenditionProfile

    Change the rendition profile on several folders with the same name at once with Set-PWFolderRenditionProfile?

    Erik Holmqvist
    Offline Erik Holmqvist over 5 years ago

    Tried to change to rendition profile for several folders with a powershell script but with no success. 

    Tried something very similar to what I have for changing several views at once, which looks like this:

    ## IMPORT PWPS_DAB.DLL
    Import-Module -Name "PWPS_DAB" -DisableNameChecking
    
    ## Choose folder and its subfolder which it searching in
    $TargetFolder = "Project\"
    
    ## Specify which folder that you want to change view
    $ThisFolder = "Drawings"
    
    
    ## Choose which view you want to change to
    $ThisView = "Ritningsvy"
    
    ############################################ SCRIPT ############################################################
    New-PWLogin -UseGui 
    $Folders = get-pwfolders -folderpath $TargetFolder -Slow | where-object -Property "Name" -Like -Value $ThisFolder
    $Folders | Set-PWFolderView -View $ThisView
    ############################################ SCRIPT ############################################################
    
    ## Logging out
    Undo-PWLogin

    Is it possible to do something similar with Set-PWFolderRenditionProfile?

    Thanks!

    • Sign in to reply
    • Cancel

    Top Replies

    • Brian Flaherty
      Offline Brian Flaherty Thu, Mar 22 2018 2:28 PM +3 suggested
      I have updated each of the rendition cmdlets to accept inputfolders from the pipeline. Get-PWFolderRenditionProfile, Set-PWFolderRenditionProfile and Remove-PWFolderRenditionProfile. Look for them in…
    • Brian Flaherty
      Offline Brian Flaherty Thu, Mar 22 2018 11:43 AM +1
      Currently, the Set-PWFolderRenditionProfile does not accept pipeline input. This can be added. Look for it in a future release of the PWPS_DAB module. At this point, you could use a foreach loop to apply…
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Mar 22 2018 2:10 PM +1 verified
      this worked for me. I changed up some things to my own preferences # allow -vebose/-debug parameters [CmdletBinding()] param() Import-Module -Name "PWPS_DAB" -DisableNameChecking ## Choose folder…
    Parents
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, Mar 22 2018 11:43 AM

      Currently, the Set-PWFolderRenditionProfile does not accept pipeline input. This can be added. Look for it in a future release of the PWPS_DAB module.

      At this point, you could use a foreach loop to apply to each folder.

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Erik Holmqvist
      0 Offline Erik Holmqvist Thu, Mar 22 2018 11:49 AM in reply to Brian Flaherty

      Yeah now that you mention it, it said something about dont accept pipeline input :)

      Acutally tried to it with a foreach loop, but my knowledge about powershell is quite basic so I gave up. Do you mind giving me some guidance in the right directions? thanks!

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Mohammad Masud
      0 Offline Mohammad Masud Thu, Mar 22 2018 4:32 PM in reply to Erik Holmqvist

      $TargetFolder = "Project\"
      $ThisFolder = "Drawings"
      $ThisView = "Ritningsvy"
      
      $folders = Get-PWFolders -FolderPath $TargetFolder -Slow | Where {$_.Name -like $ThisFolder} 
      
      foreach ($folder in $folders) 
      { 
          Set-PWFolderView -InputFolder $folder -View $ThisView -PreviewPaneView $ThisView
      }

      Try the above. See if it works. A nice-to-have would be if View and PreviewPaneView would generate the available values automatically.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Mohammad Masud
      0 Offline Mohammad Masud Thu, Mar 22 2018 4:32 PM in reply to Erik Holmqvist

      $TargetFolder = "Project\"
      $ThisFolder = "Drawings"
      $ThisView = "Ritningsvy"
      
      $folders = Get-PWFolders -FolderPath $TargetFolder -Slow | Where {$_.Name -like $ThisFolder} 
      
      foreach ($folder in $folders) 
      { 
          Set-PWFolderView -InputFolder $folder -View $ThisView -PreviewPaneView $ThisView
      }

      Try the above. See if it works. A nice-to-have would be if View and PreviewPaneView would generate the available values automatically.

      • 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