Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Automatically create "PDF" folder in all existing projects
    • Sign In

    • State Not Answered
    • Replies 4 replies
    • Subscribers 66 subscribers
    • Views 1107 views
    • Users 0 members are here

    Automatically create "PDF" folder in all existing projects

    NicolasT
    Offline NicolasT over 5 years ago

    Hello, is it possible to (quickly/automated instead of manual one-by-one) create a subfolder "PDF" with a workflow "PDF" in all my existing Projects ? thx

    • Sign in to reply
    • Cancel
    Parents
    • Brian Flaherty
      0 Offline Brian Flaherty Tue, Jul 31 2018 8:26 AM

      Let me know if this works for you.

      # Specify New Folder Name.
      $NewFolderName = 'PDF'
      # Specify New Folder Description.
      $NewFolderDescription = 'Contains PDF files'
      # Specify Environment to be used.
      $Environment = 'Complex'
      # Specify storage area to be used.
      $StorageArea = 'Storage_01'

      # Get all Rich Projects / Work Areas
      $PWRichProjects = Get-PWRichProjects -Verbose
      # Loop thru all projects returned.
      foreach ($PWRichProject in $PWRichProjects)
      {
          # Using splatting for readability.
          $NewFolderInfo = @{
              FolderPath = "$($PWRichProject.FullPath)\$NewFolderName"
              Description = $NewFolderDescription
              Environment = $Environment
              StorageArea = $StorageArea
          }
          New-PWFolder @NewFolderInfo -Verbose
      }

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Tue, Jul 31 2018 10:24 AM in reply to Brian Flaherty

      this assumes all the PDF folders will use the same storage area. Might be better to get the storage area from the rich project and use that one. each of our rich projects gets it's own storage area.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Tue, Jul 31 2018 12:02 PM in reply to Kevin van Haaren

      That's a very good point. Easy enough to accomplish.

      Set the StorageArea parameter equal to the current RichProject storage area.

          $NewFolderInfo = @{
              FolderPath = "$($PWRichProject.FullPath)\$NewFolderName"
              Description = $NewFolderDescription
              Environment = $Environment
              StorageArea = $PWRichProject.Storage
          }

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • NicolasT
      0 Offline NicolasT Tue, Aug 7 2018 4:21 AM in reply to Brian Flaherty

      Hello,

      Sorry for the delay. Thank you very much indeed for your help. Much appreciated.

      We are still struggling a bit with our IT dept. The Powershell scripts are not allowed for security issues. We need to have special approvals for this - and follow request procedures etc. To be continued. Keep you posted on the outcome.

      Best regards,

      Nico

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • NicolasT
      0 Offline NicolasT Tue, Aug 7 2018 4:21 AM in reply to Brian Flaherty

      Hello,

      Sorry for the delay. Thank you very much indeed for your help. Much appreciated.

      We are still struggling a bit with our IT dept. The Powershell scripts are not allowed for security issues. We need to have special approvals for this - and follow request procedures etc. To be continued. Keep you posted on the outcome.

      Best regards,

      Nico

      • 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