Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

how do I input data for a switch parameter?

$
0
0
Complete newbie to powershell...I have set a parameter to be mandatory, but I am not familiar with the input format to make it work. My parameter looks like this 
[Parameter(Mandatory = $true)[switch] $isValid
now when I run my code and it asks for the input value for $isValid, what is the right syntax? So far i have tried just typing "$true", "false", "1", "0", '-isValid"(all without the quotes), but it doesn't accept anyone I have tried to put in. Any Ideas how I can get my code to accept the input?

Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>