Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Using credential param as optional..

$
0
0

I don’t know if it’s “better,” but you can certainly do:

if ($PSBoundParameters.ContainsKey('credential')) {
 # you have one
} else {
 # you don't
}

Viewing all articles
Browse latest Browse all 13067

Trending Articles