title: Creating a dynamically-named variable in PowerShell
body: <p>I'd like to create the variable <code>offsetX</code>, where <code>X</code> is some number. Right now, I use:</p>
  
  <pre><code>new-variable -name offset$i
  </code></pre>
  
  <p>where <code>$i</code> is an integer. However, what I really want is <code>offset($i-1)</code>. How would I change the syntax of the above statement to accomplish this?</p>
  
  <p>My latest attempt was:</p>
  
  <pre><code>new-variable -name offset+"[int]$i-1"
  </code></pre>
  
  <p>which didn't result in an error being thrown, but still doesn't accomplish my goal.</p>