Working around some strange editionCommandTask issues and PowerShell

There seems to be some peculiar differences between executing a command line task using the editionCommandTask vs using a windows command line. When using the task and trying to execute a powershell script I found the task wold completely lock up for example

POWERSHELL -NoLogo -NonInteractive -NoProfile -File "D:\Scripts\Publish-Staging.ps1"

. I was able to get the script to execute by placing it in a batch file using the following

POWERSHELL -NoLogo -NonInteractive -NoProfile -File "D:\Scripts\Publish-Staging.ps1" < NUL

. This works except for when I began using a 3rd party snap-in (CloudBerry) to push files into the cloud. Everything would execute except for the cloudberry commands which led me to my latest solution. Instead of actually executing anything using the editionCommandTask I use it instead to kick off a scheduled task that does all the heavy lifting and seems to be more friendly with powershell script execution.

SCHTASKS /Run /TN "Publish-Staging"

If anyone else chooses to make use of this solution beware that the kick off of the task is asynchronous so the publishing job in Percussion will not wait while the scheduled task completes. More importantly this will also mask failures in the publishing process as the scheduled task may later fail while the publishing process reports success. Checking both the scheduled task log and the percussion publish logs would need to become part of the diagnostic process.