Including the '>' redirect character in the Parameters list in Execute-Process

Topics: Archive - Deployment Scripts
Mar 2, 2015 at 11:08 PM
I am trying to run the following command in the installation section of my install script.

$param1 = "/xmlout /catalog >result.xml"
Execute-Process -Path mbsacli.exe -Parameters '/xmlout /catalog >result.xml' -WindowStyle Hidden
If I just run:
Execute-Process -Path mbsacli.exe -Parameters '/xmlout /catalog' -WindowStyle Hidden
then the process works fine, but as soon as I add the >reports.xml to the command, I get "Too many parameters passed" from the mbsacli.exe tool. However, according to the mbsacli tool, this is the proper way to run the command:
MBSACLI /xmlout /catalog c:\temp\ /unicode >results.xml
Is Powershell hitting the '>' character and going something weird?