【发布时间】:2020-10-14 11:50:26
【问题描述】:
我正在尝试调用 PHP 文件,使用 Powershell 在本地 URL 中传递 request_number
在 HTML 中:
<a href='workflow_execution_progress.php?view_id=".$row['request_number']."' title='Click to see the progress of workflow'>
我参考了这个链接,但不确定是否使用参数对其进行修改。 Executing php script on powershell
更新:我的 PowerShell
$PhpExe = "C:\path\to\php\install\dir\php.exe"
$PhpFile = "C:\path\to\script.php"
$PhpArgs = '-f "{0}"' -f $PhpFile //args like view_id = 1 / 2 /3 (dynamically)
$PhpOutput = & $PhpExe $PhpArgs
【问题讨论】:
-
如果通过powershell调用本地PHP文件,则不涉及“url”(因为您没有发出网络请求)。
-
是的,它现在是本地文件。将在项目完成后部署。我的问题是如何使用 PowerShell 脚本 @MagnusEriksson 将动态 id 传递给 PHP 文件
-
@MagnusEriksson 抱歉,我不知道如何在我的 powershellcode 中添加它 $PhpExe = "C:\path\to\php\install\dir\php.exe" $PhpFile = "C: \path\to\script.php" $PhpArgs = '-f "{0}"' -f $PhpFile
标签: php powershell parameter-passing