Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Using Powershell to update environment attributes lengths
    • Sign In

    • State Verified Answer
    • Replies 5 replies
    • Subscribers 67 subscribers
    • Views 2631 views
    • Users 0 members are here

    Using Powershell to update environment attributes lengths

    Sebastian Francisco
    Offline Sebastian Francisco over 5 years ago

    Can someone point out the correct syntax to use powershell to update attribute lengths. When I created the attribute the length was set as 20 and now i would like to change that length to 26. IS there a way to do that  through power shell?

    • Sign in to reply
    • Cancel

    Top Replies

    • Mohammad Masud
      Offline Mohammad Masud Fri, Mar 2 2018 10:39 PM in reply to Sebastian Francisco +2 verified
      # Install the latest and greatest Uninstall-Module -Name pwps_dab Install-Module -Name pwps_dab -Force # Restart PS and log onto your datasource Open-PWConnection -GUI -Admin <# Update the attribute…
    • Paul Patterson
      Offline Paul Patterson Fri, Mar 2 2018 3:52 PM +1 verified
      Here's an example Update-PWEnvironmentColumnWidth -EnvironmentName 'Enviro' -ColumnName 'DOC_STATUS' -NewWidth '35'
    Parents
    • Sebastian Francisco
      0 Offline Sebastian Francisco Fri, Mar 2 2018 3:55 PM

      Awesome. I think that looks exactly like what i need. Follow up question. I need to login to datasource with powershell first correct? Can you show that as well. I am a powershell noob.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Mohammad Masud
      +1 Offline Mohammad Masud Fri, Mar 2 2018 10:39 PM in reply to Sebastian Francisco

      # Install the latest and greatest
      Uninstall-Module -Name pwps_dab
      Install-Module -Name pwps_dab -Force
      
      # Restart PS and log onto your datasource
      Open-PWConnection -GUI -Admin
      
      <#
          Update the attribute length. 
          Note that:
          Switch parameter EnvironmentName can have space, so quotes are used, double quotes are preferable as they can be used with variables as well as a value.
          A Column name cannot have space, so use of quote is not necessary.
          -NewWidth is an integer, so do not use quote. 
          -verbose switch just gives you more information about the command processing; it is optional but good to understand how each cmdlet is working.
      #>
      
      
      Update-PWEnvironmentColumnWidth -EnvironmentName "Environment Name" -ColumnName Column_Name -NewWidth 26 -Verbose

      Answer Verified By: Sebastian Francisco 

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Reject Answer
      • Cancel
    Reply
    • Mohammad Masud
      +1 Offline Mohammad Masud Fri, Mar 2 2018 10:39 PM in reply to Sebastian Francisco

      # Install the latest and greatest
      Uninstall-Module -Name pwps_dab
      Install-Module -Name pwps_dab -Force
      
      # Restart PS and log onto your datasource
      Open-PWConnection -GUI -Admin
      
      <#
          Update the attribute length. 
          Note that:
          Switch parameter EnvironmentName can have space, so quotes are used, double quotes are preferable as they can be used with variables as well as a value.
          A Column name cannot have space, so use of quote is not necessary.
          -NewWidth is an integer, so do not use quote. 
          -verbose switch just gives you more information about the command processing; it is optional but good to understand how each cmdlet is working.
      #>
      
      
      Update-PWEnvironmentColumnWidth -EnvironmentName "Environment Name" -ColumnName Column_Name -NewWidth 26 -Verbose

      Answer Verified By: Sebastian Francisco 

      • Cancel
      • Vote Up +2 Vote Down
      • Sign in to reply
      • Reject 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