r/PowerShell • • Apr 05 '19

PowerShell tricks: Splatting

https://blog.destruktive.one/powershell-tricks-splatting/
150 Upvotes

58 comments sorted by

View all comments

1

u/TheRealMisterd Apr 06 '19

What they don't tell you: splitting does not work with switches

6

u/halbaradkenafin Apr 06 '19

Yes it does, just pass it in as SwitchName = $true or $false and it'll pass in the switch correctly.

2

u/TheRealMisterd Apr 06 '19

This is new. Windows 7 with ps4 would give an error regardless of what you did.

1

u/PMental Apr 08 '19

Powershell 5+ works fine on Windows 7 though and was released 3 years ago so not exactly "new" :-)