I\'m writing a custom PowerShell cmdlet, and I would like to know which is the proper way to validate a parameter.
I thought that this could be done either in the proper
If possible, it's preferred that the parameters be validated by the runtime by specifying Validation Attributes on the parameter definition.
Windows PowerShell can validate the arguments passed to cmdlet parameters in several ways. Windows PowerShell can validate the length, the range, and the pattern of the characters of the argument. It can validate the number of arguments available (the count).