Here is a sample:
<cfset cmd="get-date -format g" />
<cfset args="-inputformat none -Command " & cmd />
<cfoutput>
<cfexecute name="powershell.exe" variable="result" errorvariable="err"
arguments="#args#" timeout="99" />
<p>Result: <cfif result neq "">#result#<cfelse>None</cfif></p>
<p>Error: <cfif err neq "">#err#<cfelse>None</cfif></p>
</cfoutput>
On Windows 2008 R2 with ColdFusion 10, this will accurately put the PowerShell command's output into the result variable. After upgrading to ColdFusion 11, this code will execute with no errors but there is no result.
If I try some other command that will save a file or something, there is no evidence that the PowerShell command is even being executed.
I've tested against an upgraded ColdFusion 11, and by installing ColdFusion 11 fresh. In all cases, I'm using CF as a stand-alone server. I've tried with or without CF 11 updates/hotfixes. I've verified that the user account that CF is running as has permission to execute PowerShell.
Your help and/or corroboration of this problem is appreciated. What am I missing? If this is a bug, any ideas on how to execute some PowerShell commands from CF 11 moving forward?
Thanks for taking a look!