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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PowerShell will actually treat any comma-separated list as an array:
So the @ is optional in those cases. However, for associative arrays, the @ is required:
Officially, @ is the ‘array operator.’ You can read more about it in the documentation that installed along with PowerShell, or in a book like ‘Windows PowerShell: TFM,’ which I co-authored.