Author Posts

September 25, 2015 at 1:00 am

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

September 25, 2015 at 1:14 am

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

function Test-Args
{
    $args.Count
}

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.

September 25, 2015 at 3:41 am

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.

September 25, 2015 at 5:24 am

You're mixing up @args with @arrr. The latter being the splatting of pirates foes.... 🙂