This project is read-only.

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

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

$param1 = "/xmlout /catalog wsusscn2.cab >result.xml"
Execute-Process -Path mbsacli.exe -Parameters '/xmlout /catalog wsusscn2.cab >result.xml' -WindowStyle Hidden
If I just run:
Execute-Process -Path mbsacli.exe -Parameters '/xmlout /catalog wsusscn2.cab' -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\wsusscn2.cab /unicode >results.xml
Is Powershell hitting the '>' character and going something weird?