Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Enumerate named parameters

$
0
0

Hi All,

I want to write a small function, which will be put in a module, that needs to be called by all scripts to track when which script has run, version,by who and a link to the transcript file.

Now I want to add listing all values for the named parameters when the script is called. My initial idea was, I pass $args, loop thru all parameters and done..

But what I found out is that as soon as I put a param definition (ex. param($url,$site) ) in a script the $args collection remains empty.

Basically the question is, is it possible and how can you loop thru all named parameters in a script without knowing the names?

rgds,

Bart


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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