I have a powershell script in a file "Publish-MyProj.ps1" with a header defined like this:
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[ValidatePattern("\d{1,2}\.\d{1,2}\.\d{1,3}")]
[string]$Version
)
When I run the script like this:
.\Publish-MyProj.ps1 10.2
It shows an error, which is an expected behaviour.
However, when I run it with an almost alright version:
.\Publish-MyProj.ps1 111.2.25
It does not fail, even though the first number exceeds the number of allowed digits.
Is it a bug or am I doing it wrong?