I've seen the @ symbol used in PowerShell to initialise arrays.
@
What exactly does the @ symbol denote and where can I read more about it?
In PowerShell V2, @ is also the Splat operator.
PS> # First use it to create a hashtable of parameters: PS> $params = @{path = "c:emp"; Recurse= $true} PS> # Then use it to SPLAT the parameters - which is to say to expand a hash table PS> # into a set of command line parameters. PS> dir @params PS> # That was the equivalent of: PS> dir -Path c:emp -Recurse:$true
2.1m questions
2.1m answers
60 comments
57.0k users