小编Jim*_*myP的帖子

Powershell 启动进程参数问题

可能是一个完全的菜鸟问题,但是:

当我跑

Start-Process ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -RedirectStandardOutput ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log" -RedirectStandardError  ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log" -WindowStyle Hidden
Run Code Online (Sandbox Code Playgroud)

我收到错误

Start-Process : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:14
+ Start-Process <<<<  ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -RedirectStandardOutput ".\packages\
PS-Get.0.1.0.0\NuGet.exe.Update.log" -RedirectStandardError  ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log" -WindowStyle Hidden
+ CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.StartProcessCommand
Run Code Online (Sandbox Code Playgroud)

但所有的:

Start-Process ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -RedirectStandardOutput ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log"

Start-Process ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -RedirectStandardError ".\packages\PS-Get.0.1.0.0\NuGet.exe.Update.log"

Start-Process ".\packages\PS-Get.0.1.0.0\NuGet.exe" update -WindowStyle Hidden
Run Code Online (Sandbox Code Playgroud)

工作正常......我错过了什么?

powershell parameters

4
推荐指数
1
解决办法
6908
查看次数

标签 统计

parameters ×1

powershell ×1