How do single-quoted and double-quoted strings differ in PowerShell ?
Documentation: Microsoft Learn
Double-quoted strings expand variables and subexpressions; single-quoted strings are literal except for the escape rules needed to represent a quote.
Interview · Question 2 of 34
Answer before reveal
Your draft
Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.
A strong answer
Double-quoted strings expand variables and subexpressions; single-quoted strings are literal except for the escape rules needed to represent a quote. Choose the form that matches the intended data.
Show it concretely
$name='server01' "Target: $name" 'Target: $name'
Expect this follow-up
When would you prefer a format string or here-string instead?