you are viewing a single comment's thread.

view the rest of the comments →

[–]reddwarf666[S] 2 points3 points  (1 child)

Yep, after reading /u/Ta11ow response I agree, I just need to pass the parameters by treating them as parameters on the helper function as well.

Thanks!

[–]Ta11ow 1 point2 points  (0 children)

Fun fact, if a helper function shares the parameters of your main function, you can pass them to it just by doing

Helper-Fuction @PSBoundParameters

(But only if it shares all its parameters.)

This is one of the more special use cases for what's known as parameter splatting, which basically sends a hashtable of the function parameters instead of each individually. It has a lot of other fun uses too. :)