【发布时间】:2016-11-26 01:04:47
【问题描述】:
我正在尝试使用以下代码将用户提供的值传递给 PowerShell 脚本,但没有运气:
<cfset MyVar="Woila!">
<cfoutput>
<cfexecute name="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
arguments="$MyVar = #MyVar# C:\Users\raimonds\Desktop\create_website_IIS_aws_uat_1.ps1"
/>
</cfoutput>
参数写入 PowerShell 命令行,但它没有将变量传递到具有此语法 $MyVar 的 .ps1 脚本中。
【问题讨论】:
-
顺便说一句,没有必要将
<cfexecute>标签包裹在<cfoutput>中。标签内的 CF 变量将被自动评估。
标签: powershell iis coldfusion cfexecute