0

Recently, I saw a PowerShell array written like this:

$qCommand = @"
<View Scope="RecursiveAll">
<Query>
    <OrderBy><FieldRef Name='ID' Ascending='TRUE'/></OrderBy>
</Query>
<RowLimit Paged="TRUE">5000</RowLimit>
</View>
"@

I've not encountered this kind of syntax yet with PowerShell arrays, only the standard @().

What's @"..."@ for?

1
  • Run the command help about_Quoting_Rules and read on. Commented Nov 13, 2017 at 15:47

1 Answer 1

2

It's not an array but rather a Here-String.

The Here-String construction provides an easy way for handling text, it's specialty is dealing with speech marks and other delimiters without the need for inserting escape characters.

Quoted from: http://www.computerperformance.co.uk/powershell/powershell_here_string.htm

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.