title: Why do I need the subexpression operator in this example?
body: <p>A textbook example says</p>
  <pre><code>trap {&quot;trapped : $($error[0])&quot;; break}
  </code></pre>
  <p>in PowerShell. Why do I need the subexpression operator <code>$( )</code>? As a beginner I would see</p>
  <pre><code>trap {&quot;trapped : $error[0]&quot;; break}
  </code></pre>
  <p>enough as PowerShell does variable substitution in strings with double quotes.</p>
  <p>Of course the latter does not work. Why?</p>