What does the "@" symbol do in Powershell?

GrahamMc picture GrahamMc · Dec 12, 2008 · Viewed 111.1k times · Source

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?

Answer

Jeffrey Snover - MSFT picture Jeffrey Snover - MSFT · Feb 22, 2009

In PowerShell V2, @ is also the Splat operator.

PS> # First use it to create a hashtable of parameters:
PS> $params = @{path = "c:\temp"; 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:\temp -Recurse:$true