如何解决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 举报,一经查实,本站将立刻删除。