Can someone help explain on how @args works ? Do i pass objects to it ? Any examples would be great, thanks.

$args is an automatic variable which contains all of the unbound arguments passed to a non-advanced function. For example:

function Test-Args

Test-Args 1 2 3 4 5

When you use @args, you’re splatting this array to some other command. See the about_Splatting help file for more details on that.

Sweet Jesus and all this time I thought it had something to do with Pirates… I love this site 4 weeks ago I did not know any PowerShell now after reading 4 books and 3 MVA courses im so addicted to it I find my self trying to apply it to everything. I have already applied what I have learned to several real world issues within my IT environment. The local desktop guys love the scripts I give them.

You’re mixing up @args with @arrr. The latter being the splatting of pirates foes… :slight_smile:

LOL that’s funny