title: PowerShell equivalent of “dirname $0” from bash
body: <p>I've used <code>dirname &quot;$0&quot;</code> which is an idiom to determine the path of the running script in bash, e.g.:</p>
  <pre class="lang-bash prettyprint-override"><code>pushd &quot;$(dirname &quot;$0&quot;)&quot;
  </code></pre>
  <pre class="lang-bash prettyprint-override"><code>data_dir=&quot;$(dirname &quot;$0&quot;)/data/&quot;
  </code></pre>
  <p>What's PowerShell equivalent of the above idiom?</p>