I have a Powershell script like this
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$variable1,
[Parameter(Mandatory=$True,Position=2)]
[string]$variable2,
[Parameter(Mandatory=$True,Position=3)]
[int]variable3
)... something happens then
Now I want to check before going on with the script if variable 1 for example is A, B or C variable2 is D,E or F and variable3 is 1,4,5
is there any possibility to check the Parameters right after Input? So that if variable1 Errors you have to redo it but if variable2 has a error you just have to redo variable2 and not variable1 as well?