<p>I'm trying to get this simple PowerShell script working, but I think something is fundamentally wrong. ;-)</p>
<pre><code>ls | ForEach { &quot;C:\Working\tools\custom-tool.exe&quot; $_ }
</code></pre>
<p>I basically want to get files in a directory, and pass them one by one as arguments to the custom tool.</p>

```
```
ls | %{C:\Working\tools\custom-tool.exe $_}
```
```
As each object comes down the pipeline the tool will be run against it.  Putting quotes around the command string causes it to be... a string!  The local variable "$_" it then likely doesn't know what to do with so pukes with an error.