Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Convert-PWFolderToRichProject and Set-PWWorkAreaTypeForRichProject - not setting Work Area Type
    • Sign In

    • State Not Answered
    • Replies 3 replies
    • Subscribers 65 subscribers
    • Views 360 views
    • Users 0 members are here

    Convert-PWFolderToRichProject and Set-PWWorkAreaTypeForRichProject - not setting Work Area Type

    Chris Spencer
    Offline Chris Spencer over 1 year ago

    I am having Problems upgrading a folder to a Project / Work Area and actually setting the type. I can upgrade a folder to a Rich Project, however I can’t set the Project Type. Any ideas anyone?

    Commands:

    Convert-PWFolderToRichProject

    Set-PWWorkAreaTypeForRichProject

    Pwps_dab version : 2.1.10.0

     As can be seen in PW Admin the Project Type (Or now Work Area Type) exists.

     

    Output from various commands:

     

    PS C:\WINDOWS\system32> $ProjFolder
    Projects\Test Project 456
    
    PS C:\WINDOWS\system32> $ProjType
    ISO19650 Projects
    
    PS C:\WINDOWS\system32>     Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne) -SetType -ProjectType $ProjType -Verbose
        Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne) -ProjectType $ProjType -Verbose
        Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne)  -Verbose
    
        Set-PWWorkAreaTypeForRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne) -ProjectType $ProjType -Replace -verbose
        
    Convert-PWFolderToRichProject : ISO19650 Projects not found in current datasource.
    At line:1 char:5
    +     Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -Folder ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (ISO19650 Projects:String) [Convert-PWFolderToRichPro 
       ject], Exception
        + FullyQualifiedErrorId : Error getting ProjectType.,PWPS_DAB.ConvertPWFolderToRichProject
     
    Convert-PWFolderToRichProject : ISO19650 Projects not found in current datasource.
    At line:2 char:5
    +     Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -Folder ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (ISO19650 Projects:String) [Convert-PWFolderToRichPro 
       ject], Exception
        + FullyQualifiedErrorId : Error getting ProjectType.,PWPS_DAB.ConvertPWFolderToRichProject
     
    VERBOSE: Successfully upgraded folder to Rich Project / Work Area.
    True
    WARNING: No Work Area type set for 'Test Project 456'.
    

    The first two Convert-PWFolderToRichProject commands fail as I try and set the project type, so I just try and upgrade to a rich project alone without a project type which is fine on the 3rd command. Last command also fails setting the type via Set-PWWorkAreaTypeForRichProject

     

    It looks like the cmdlets can’t use the ‘ISO19650 Projects’ type that can be seen in the first screenshot for whatever reason.

     

    Any ideas?

    • Sign in to reply
    • Cancel
    Parents
    • Robert McMillan
      0 Offline Robert McMillan Wed, Aug 24 2022 7:04 PM

      Try checking the Rich Project class names in that datasource with Get-PWRichProjectTypes. If a Work Area Type is renamed in PW Admin (or contains spaces) I believe what you are seeing is the display name not the class name. Convert-PWFolderToRichProject may be expecting the class name which can be obtained with the get-PWRichProjectTypes and in your case I suspect the answer will be ISO19650_Projects.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Reply
    • Robert McMillan
      0 Offline Robert McMillan Wed, Aug 24 2022 7:04 PM

      Try checking the Rich Project class names in that datasource with Get-PWRichProjectTypes. If a Work Area Type is renamed in PW Admin (or contains spaces) I believe what you are seeing is the display name not the class name. Convert-PWFolderToRichProject may be expecting the class name which can be obtained with the get-PWRichProjectTypes and in your case I suspect the answer will be ISO19650_Projects.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    Children
    • Chris Spencer
      0 Offline Chris Spencer Thu, Aug 25 2022 6:21 AM in reply to Robert McMillan

      Hi Robert

      It looks like ISO19650 Projects used to be called something else. As it is the only Work Area Type it must have been according to the output of Get-PWRichProjectTypes
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Get-PWRichProjectTypes
       
       
      ClassName : BS1192_Projects
      ClassDesc :
      TableName : I_BS1192_PROJECTS
      SeqName : SEQ_BS1192_Projects
      CatName :
      ModTime : 2022-08-01 07:59:09.917
      ClassID : 1027
      IsVersion : 0
      SystemClass : 1
      KeyID : 1038
      ClassAttrID : 0
      CatKeyID : 0
      Description : PWRichProjectType
      Name : PWRichProjectType
       
       
      I then try again with the class name via Convert-PWFolderToRichProject:
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> $ProjFolder
      Projects\Test Project 456
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> $ProjType
      BS1192_Projects
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Convert-PWFolderToRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne) -SetType -ProjectType $ProjType -Verbose
      VERBOSE: Successfully upgraded folder to Rich Project / Work Area.
      True
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0>
       
      Here your solution works great. I revert the Work Area Type back to none in PW explorer to move on and test the Set-PWWorkAreaTypeForRichProject cmdlet.
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Undo-PWLogin
      True
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> New-PWLogin @NALogin
      True
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> $ProjFolder
      Projects\Test Project 456
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> $ProjType
      BS1192_Projects
       
      PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Set-PWWorkAreaTypeForRichProject -InputFolder (Get-PWFolders -FolderPath $ProjFolder -JustOne) -ProjectType $ProjType -Replace -verbose
      WARNING: No Work Area type set for 'Test Project 456'.
       
      Thanks for your help. The conclusion is that using the ClassName obtained by Get-PWRichProjectTypes works when using the returned class name as a -ProjectType when using the Convert-PWFolderToRichProject cmdlet. However I still have no solution for the Set-PWWorkAreaTypeForRichProject cmdlet. Not an issue for what I am doing as I can get away with using Convert-PWFolderToRichProject for what I am doing.
      Maybe the help in pwps_dab can be updated to suggest using class names for the work area / project type?
      Thanks again.
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert McMillan
      0 Offline Robert McMillan Thu, Aug 25 2022 6:32 PM in reply to Chris Spencer

      Yes that makes sense, the Bentley ISO19650 template is an evolution of the previous BS1192 template so at some point it looks like some renamed the Work Area / Rich Project type. 

      • 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