Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

parameter value and value set

$
0
0

Hi

How to use default values or a collection of a set/subset of those values in the parameters of a function

eg I have a parameter 'parameter1' and it can have values : val1, val2, val3 or @(val1, val2) or @(val1, val2, val3) or .......

how do I mention such default values in the parameters:

I need something like

function exampleFunction{

parameter(

[ValidateSet("val1","val2", "val3", @(val1, val2)] $username,

)

:

:

:

}


Viewing all articles
Browse latest Browse all 2562

Trending Articles



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