且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PowerShell命令参数验证

更新时间:2023-02-03 09:34:24

如果可能的话,它是首选通过指定的参数运行时验证属性验证的参数定义。

If possible, it's preferred that the parameters be validated by the runtime by specifying Validation Attributes on the parameter definition.

Windows PowerShell中可以验证通过多种方式来cmdlet的参数的参数。 Windows PowerShell中可以验证长度,范围和参数的字符的格局。它可以验证的参数提供的数(计数)。

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).