This code works but I don’t understand why.
https://gist.github.com/macfarmw/67e318423aeb15184c623eca22b56b59
Is this dot sourcing a script block or something else?
This code works but I don’t understand why.
https://gist.github.com/macfarmw/67e318423aeb15184c623eca22b56b59
Is this dot sourcing a script block or something else?
Yeah, it’s essentially dot-sourcing a script block. Kinda. $_ represents the pipeline object being input to the script. Visually, I find it a poor practice - it isn’t appreciably different from using ForEach-Object, and it’s not as easy to understand.
Yep. Confused me.
Thanks.