Bit Shifting in PowerShell 2.0
<p>Shift left (<code>-shl</code>) and shift right (<code>-shr</code>) operators are only available with PowerShell 3.0 and higher.</p>

<p>How can I shift in PowerShell 2.0?</p>

<p>This is what I have so far. Is there a better way?</p>

<pre><code>&gt;&gt;&gt;$x = 1
&gt;&gt;&gt;$shift = 3
&gt;&gt;&gt;$x * [math]::pow(2, $shift)
8
&gt;&gt;&gt;$x = 32
&gt;&gt;&gt;$shift = -3
&gt;&gt;&gt;$x * [math]::pow(2, $shift)
4
</code></pre>