本文介绍了CFEXECUTE似乎未在ColdFusion 11中执行PowerShell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是示例:

<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>

在具有ColdFusion 10的Windows 2008 R2上,这会将PowerShell命令的输出准确地放入结果变量中.升级到ColdFusion 11后,此代码将正确执行,但没有结果.

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.

如果我尝试其他将保存文件或其他内容的命令,则没有证据表明PowerShell命令甚至正在执行.

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.

我已经通过升级安装的ColdFusion 11和全新安装的ColdFusion 11进行了测试.在所有情况下,我都将CF用作独立服务器.我尝试过使用或不使用CF 11更新/修补程序.我已验证CF所运行的用户帐户具有执行PowerShell的权限.

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.

感谢您对这个问题的帮助和/或证实.我想念什么?如果这是一个错误,那么关于如何从CF 11继续执行某些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?

感谢您的光临!

推荐答案

对于面临此问题的人们,看看答案是否在于更新CF使用的jvm.默认情况下,cf11(至少最初是)Java 1.8.0_25附带的,正如我在2016年所写的那样.

To folks facing this, see if the answer lies in updating the jvm that CF uses. By default, cf11 came (at least initially) with Java 1.8.0_25, which as I write in 2016 is dated.

尝试更新到更高的jvm版本.皮特·弗赖塔格(Pete Freitag)上有一段很好的视频,我在一篇有关挑战的博客文章中指出了这一点,如果您发现尝试这种方法后CF无法启动:

Try updating to a later jvm version. Pete Freitag has a nice video on doing it, and I point to it in a blog post dealing with challenges if you find CF won't start after trying this:

http://www.carehart.org/blog/client/index.cfm/2014/12/11/help_I_updated_CFs_JVM_and_it_wont_start

并且让我们知道更新jvm是否有帮助.

And let us know here if updating the jvm helps.

这篇关于CFEXECUTE似乎未在ColdFusion 11中执行PowerShell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 18:14