Examples/Validator/Validator.ps1

1
2
3
4
5
6
7
8
9
10
function MyValidator($thing_to_validate) {
    return $thing_to_validate.StartsWith("s")
}

function Invoke-SomethingThatUsesMyValidator {
    param(
        [ValidateScript({MyValidator $_})]
        $some_param
    )
}