Bird
0
0

Which of the following is the correct syntax for a here-string in PowerShell?

easy📝 Syntax Q3 of 15
PowerShell - Variables and Data Types
Which of the following is the correct syntax for a here-string in PowerShell?
A@"This is a here-string"@
B"@This is a here-string@"
C@'This is a here-string'@
D'@This is a here-string@'
Step-by-Step Solution
Solution:
  1. Step 1: Recall here-string syntax in PowerShell

    Here-strings start with @" and end with "@ for double-quoted strings.
  2. Step 2: Identify correct option

    @"This is a here-string"@ uses @" and "@ correctly to define a here-string.
  3. Final Answer:

    @"This is a here-string"@ -> Option A
  4. Quick Check:

    Here-string syntax = @" ... "@ [OK]
Quick Trick: Here-strings start with @" and end with "@ [OK]
Common Mistakes:
  • Using quotes inside the @ incorrectly
  • Confusing single and double quote here-strings
  • Missing the closing @" or "@

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes