在以管理员身份运行时,在Windows PowerShell中为Start-process提供选项

时间:2015-07-01 08:55:27

标签: windows powershell powershell-v2.0 powershell-v3.0

我正在尝试使用PowerShell脚本运行具有管理员权限的perl脚本。 我的PowerShell脚本具有以下命令:

start-process powershell -verb runas "perl script" -RedirectStandardError D:\testscripts\stderror.log -RedirectStandardoutput D:\testscripts\stdopt.log

当我运行其中包含上述命令的.ps1脚本时。我收到以下错误...

  

Start-Process:无法使用指定的参数集解析   命名参数。

请建议我..

1 个答案:

答案 0 :(得分:0)

试试这个:

start-process perl script.pl -RedirectStandardError "D:\testscripts\stderror.log" -RedirectStandardoutput "D:\testscripts\stdopt.log"
相关问题