MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PowerShell/comments/b9ugma/powershell_tricks_splatting/ekf6rv8/?context=3
r/PowerShell • u/destruktive • Apr 05 '19
58 comments sorted by
View all comments
Show parent comments
1
Turns out it behaves differently for cmdlets (but possible not native commands(?)):
PS C:\> function test { $args -join '-' } PS C:\> $x = @('echo', 'b', 'c') PS C:\> test $x System.Object[] PS C:\> test @x echo-b-c
Like Python's somefunc(*var) which I've wanted before, so woooo
somefunc(*var)
1 u/TheIncorrigible1 Apr 08 '19 Yes, when used with a cmdlet, it sees that as a single argument
Yes, when used with a cmdlet, it sees that as a single argument
1
u/ka-splam Apr 08 '19
Turns out it behaves differently for cmdlets (but possible not native commands(?)):
Like Python's
somefunc(*var)which I've wanted before, so woooo