powershell function validatescript