In a Powershell script, I something like this:
Invoke-Expression "& `"C:\Scripts\psftp.exe`" ftp.blah.com"
I want to pipe all output, errors etc of this to the string $output
How can I do this? I've tried >
at the end as well as $output = ...
but neither seem to catch errors and the sort.