Powershell 2.0参数绑定异常

问题描述

我正在编写一个批处理脚本,它使用powershell启动一个独立的后台进程,如下所示:

[info] Compiling 14 Scala sources and 2 Java sources to D:\Programmieren\Effort\newsapi\api\target\scala-2.12\classes ...
[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\ErrorHandler.scala:3:28: not found: type DefaultHttpErrorHandler
[error] class ErrorHandler extends DefaultHttpErrorHandler {
[error]                            ^
[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\ErrorHandler.scala:5:47: not found: type Future
[error]                                e: Throwable): Future[Result] = e match {

...

[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\generated\model\News.scala:21:54: not found: value Json
[error]     implicit lazy val newsJsonFormat: Format[News] = Json.format[News]
[error]                                                      ^
[error] 49 errors found
[error] (Compile / compileIncremental) Compilation Failed
[error] application -

此脚本在Windows 10上有效,但在Windows 7 sp1上失败。我知道Windows 7 sp1带有powershell 2.0,但是即使powershell 2.0's documentation也表明应该支持我的所有参数

如果我删除C:\Windows\System32>powershell -c "start-process C:\edgesetup\aria2c.exe -ArgumentList \"-T C:\edgesetup\x64.torrent -d C:\edgesetup\" -RedirectStandardOutput c:\bt.log -RedirectStandardError c:\bt.err -WindowStyle Hidden" start-process : 无法使用指定的命名参数解析参数集。 所在位置 行:1 字符: 14 + start-process <<<< C:\edgesetup\aria2c.exe -ArgumentList "-T C:\edgesetup\x64.torrent -d C:\edgesetup" -RedirectStandardOutput c:\bt.log -RedirectStandardError c:\bt.err -WindowStyle Hidden + CategoryInfo : InvalidArgument: (:) [start-process],ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.StartProcessCommand ,它将在Windows 7上运行。

这是Powershell 2.0的已知错误吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...