Input validation/error handling - PowerShell Studio 2021

Hi, we have just purchased PowerShell Studio 2021 and I am ready to roll out GUI tools not only for my team of system engineers but for other teams as well. Bearing that in mind, validation of input data/error handling becomes very important part of whole code. Having asked SAPIEN about input validation they referred me to .NET documentation - I do not want to dive deep into developers world therefore any working examples would come in very handy for me at this point (both validation and error handling in PS Studio 2021).

Thank you very much in advance.

You may start reading here:

Error handling:

Input Validation:

I am familiar with input validation in advanced functions but not in GUI.

I use SAPIEN as well. I’m afraid the GUI is just a windows form. It does NOTHING but provide an interface. You have to code the validation in PowerShell. There are many ways to do that and Olaf has pointed you in the right direction where to start. Bottom line is input validation is a coding practice and I’m afraid there’s no magic GUI button to enable it. As a manager you can make policies requiring input validation in all code processing user input, but you’ll need a team with experience to verify it and test it before deployment. You just need this as part of your DevOps culture.

1 Like