【发布时间】:2015-07-06 23:59:50
【问题描述】:
我正在编写一个批处理脚本来读取一些参数并启动一个 PowerShell 脚本,该脚本需要输入的参数。
到目前为止我做了什么:
Set /p arg1 = Type in a name for the data:
Set /p arg2 = Type in the directory of the project:
Set /p arg3 = Type in the programming language :
Set /p arg4 = Type in a version for the metric data:
SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%Metrics.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%' 'arg1' 'arg2' 'arg3' 'arg4'";
很遗憾,PowerShell 脚本不接受参数。
【问题讨论】:
标签: powershell batch-file