Oddbean new post about | logout
 PowerShell Helps Validate Function Parameters, Prevents Wrong Input from Entering Functions

PowerShell, a popular scripting language, provides tools to validate function parameters and prevent incorrect input from entering functions. In a recent article, Kamil Pro demonstrated how to use PowerShell to manually validate whether a number is between 1 and 100. The author showed two approaches: one with manual checks and another using templates that prompt users for correct data or error out if invalid input is provided.

Source: https://dev.to/kamilpro/do-you-allow-wrong-input-to-enter-your-function-4jo1