So, I added a regular expression (regex) validation. Now, this is just off the top of my head - I’m not a regex wizard, so the actual pattern may need to be modified. But I think that’ll take any three characters at the start, followed by a fourth character that is not a “t,” followed by any number of other characters. That’s one way to do parameter validation.
Thank you both…i think i didn’t mention the logic properly…this is what exactly i’m looking for…
For example param
(
$computername
)
argument for $computername is DBATest
The computer name should not have T alphabet, if it has T it should raise an exception and give us an indication that it has T and should ask us to continue… e.g., yes or no…if we choose ‘yes’ it should continue or ‘no’ to abort the execution…
condition is working fine now…but when the computername do not have 'T ’ ,it goes into else block and executes…i need to put a condition in else so that i ask us to continue the execution…
for e.g., computer name has T in it…do you want to proceed with the execution yes[y], No [n] :