代码之家  ›  专栏  ›  技术社区  ›  Dave

从“second”Powershell进程获取返回代码

  •  0
  • Dave  · 技术社区  · 7 年前


    powershell.exe -noprofile -command "&{ start-process -FilePath 'powershell.exe' -ArgumentList '-noprofile get-service' -verb RunAs}"

    这将以管理员身份再次执行powershell.exe和powershell.exe。
    我想要的是“第二个”powershell.exe的错误代码,而不是“第一个”的错误代码。

    0 回复  |  直到 7 年前