Friday, November 15, 2013

PowerShell 2.0 cannot support -Dsf.asyncRequestId

I noticed the parameter to retrieve results no longer worked for me, for instance this command,
ant prodTest -Dsf.asyncRequestId=04s700000008UmkAAE
would get Ant to start a new deployment, not retrieving the results.  If I swap the target and the argument, it will just say it's an invalid target.  After trying to no avail to understand why, I opened a case with SFDC.  They were prob just as baffled, and asked me to upgrade Ant and some other things.  I didn't think 1.9.0 and 1.9.2 were that big a difference, then it dawned on me that this started to happen when I started to use PS 2.0 as my default shell on Windows.  When I switched back to the good ol' CMD.exe, it worked without a hitch!

Since the ant command on Windows is actually a BAT file, it's possible that PS 2.0 somehow parses the arguments differently from the classic CMD, which breaks the eventual Java command string generated by the BAT.  Didn't really look into it, just my guess.  Since PS 2 is included in Windows 7 by default with many features, any Salesforce Migration Tool user who attempts to use PS2 as the command line shell needs to be aware this problem.