Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum Blog Posts - Parameter Validation (Variable Validation Attributes)
    • Sign In

    • Replies 2 replies
    • Subscribers 65 subscribers
    • Views 346 views
    • Users 0 members are here
    • powershell
    • ProjectWise
    • pwps_dab
    • ProjectWise PowerShell Modules

    Blog Posts - Parameter Validation (Variable Validation Attributes)

    Brian Flaherty
    Offline Brian Flaherty over 3 years ago

    Hey everyone,

    I have added 2 Blog Posts explaining how to use Parameter Validation (Variable Validation Attributes and how to add ProjectWise specific Variable Validation Attributes.

    http://powerwisescripting.blog/2020/08/24/howto-use-parameter-validation-in-powershell-for-projectwise-1-of-2/

    http://powerwisescripting.blog/2020/08/24/howto-use-parameter-validation-in-powershell-for-projectwise-2-of-2/

    Hopefully you find them interesting and useful.

    Cheers,

    Brian

    • Sign in to reply
    • Cancel
    Parents
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Aug 27 2020 8:46 AM

      nice. part 2 has lots of stuff i didn’t know, probably going to write some of those now. thanks.

      in your part 1 validation test for a folder, i usually add the -PathType Container so i can verify they sent a folder and not a file.
      [ValidateScript({ Test-Path -Path $_ })]

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    Reply
    • Kevin van Haaren
      Offline Kevin van Haaren Thu, Aug 27 2020 8:46 AM

      nice. part 2 has lots of stuff i didn’t know, probably going to write some of those now. thanks.

      in your part 1 validation test for a folder, i usually add the -PathType Container so i can verify they sent a folder and not a file.
      [ValidateScript({ Test-Path -Path $_ })]

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Cancel
    Children
    • Brian Flaherty
      Offline Brian Flaherty Thu, Aug 27 2020 9:46 AM in reply to Kevin van Haaren

      Good hear that this is useful for you Kevin. :)  

      Also, I typically put the -PathType as well. Obviously missed it here. Thanks for pointing it out. I will update.  Cheers.

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