title: PowerShell | Add DIR to PATH | Use in Script
body: <p>I've been learning PowerShell and the best way to learn is by doing.
  Scenario:</p>
  <pre><code>D:\Tools\chainsaw\chainsaw.exe
  D:\Tools\chainsaw\mapping_files\
  D:\Tools\chainsaw\sigma_rules\
  </code></pre>
  <p>I added <code>D:\Tools\chainsaw\</code> to my PATH</p>
  <p>I have my Event Logs in let's say <code>C:\TestEventLogs\</code> which I make my current Directory in PowerShell</p>
  <pre><code>chainsaw.exe hunt ./ --rules sigma_rules/ --mapping mapping_files/sigma-mapping.yml --csv text.csv
  </code></pre>
  <p>Now a command like the below would fail because although PowerShell can find chainsaw.exe because it's in my PATH, it's unable to locate the other folders specified by the other two arguments <code>--rules sigma_rules/ --mapping mapping_files/sigma-mapping.yml</code></p>
  <p>Any tips or workaround to this would be appreciated. I am trying to automate some stuff using PS functions and arguments, and I'm stuck at making this work because I don't want to hardcode <code>D:\Tools\chainsaw\mapping_files\</code> and <code>D:\Tools\chainsaw\sigma_rules\</code> in the commandline.</p>