title: How to truncate text in string after/before separator in PowerShell
body: <p>I want to make a PowerShell script that takes each file of my music library and then does a hash sum of it and writes that into a file like so:</p>
  <pre class="lang-none prettyprint-override"><code>test.txt ; 131 136 80 89 119 17 60 123 210 121 188 42 136 200 131 198
  </code></pre>
  <p>When I start the script, I need it to first compare my music library with the already existing values, but for this I just want to cut off everything after the <code>;</code> so that it can compare filename against filename (or filepath)... but I'm stumped at how to do that.</p>
  <p>I tried replacing the value via <code>$name = $name -replace &quot;;*&quot;,&quot;&quot;</code>, but that didn't work. I also tried to filter... but I don't know how.</p>