You are not logged in.
For example, can I do this?
$i1 = 1
$i2 = 10
[ValidateRange($i1,$i2)]$number = Read-Host "Enter number 1-10"
Offline
You can do that with ValidateScript() rather than ValidateRange()
$i1 = 1
$i2 = 10
[int32][ValidateScript( {
($_ -ge $i1) -AND ($_ -le $i2)
}
)]$number = Read-Host "Enter number 1-10"
The script block just has to return TRUE or FALSE
Offline