我嘗試使用下面的代碼通過用戶提供的價值爲PowerShell腳本,但我有沒有運氣:如何通過CFExecute參數將變量傳遞到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命令行,但不經過可變進帶有此語法的.ps1腳本$MyVar
。
順便說一句,沒有必要在''中包裝''標籤。標籤內的CF變量將被自動評估。 –
Leigh