Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Folder not found during Set-PWEnvironmentByFolderPath
    • Sign In

    • State Verified Answer
    • Replies 2 replies
    • Subscribers 65 subscribers
    • Views 325 views
    • Users 0 members are here
    • powershell
    • powershellscripting
    • ProjectWise
    • pwps_dab

    Folder not found during Set-PWEnvironmentByFolderPath

    Bhanu Chauhan
    Offline Bhanu Chauhan 9 months ago

    Hello,

    I am trying to set the environment of a folder and all its subfolders. It's able to find all folders and their ID with line 7 (of the image below), but when I try to set the environment it returns the warnings "Folder 'XXXX' not found". The environment is loaded in the work area and can be manually applied.

    $folders=Get-PWFolders -FolderPath '01 - Civil & Structures (CS)\4444-TestProject\02-Civil & Structure\02-BIM'
    
    foreach ($folder in $folders)
    {
    Set-PWEnvironmentByFolderPath $folder.ProjectID -Environment 'WSP Drawings' -Verbose
    }

    • Sign in to reply
    • Cancel

    Top Replies

    • Robert McMillan
      Offline Robert McMillan Thu, Dec 15 2022 9:59 PM +3 verified
      Try specifying the parameter name -FolderID on line 5 as it may be searching for a -FolderPath by default and then not finding a folder named '8460'. Set-PWEnvironmentByFolderPath -FolderID $folder.ProjectID…
    • Robert McMillan
      +1 Offline Robert McMillan Thu, Dec 15 2022 9:59 PM

      Try specifying the parameter name -FolderID on line 5 as it may be searching for a -FolderPath by default and then not finding a folder named '8460'.

      Set-PWEnvironmentByFolderPath -FolderID $folder.ProjectID -Environment 'WSP Drawings' -Verbose

      Alternatively if you are trying to run this for all folders in the path you can consolidate that all down to this by including the -SubFolders switch.

      Set-PWEnvironmentByFolderPath -FolderPath '01 - Civil & Structures (CS)\4444-TestProject\02-Civil & Structure\02-BIM' -SubFolders -Environment 'WSP Drawings' -Verbose

      Answer Verified By: Bhanu Chauhan 

      • Cancel
      • Vote Up +3 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    • Bhanu Chauhan
      0 Offline Bhanu Chauhan Thu, Dec 15 2022 10:11 PM in reply to Robert McMillan

      Thanks for the quick response. It worked fine. I was going by the example in the help.

      • 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