Why is Powershell ISE showing errors that Powershell console does not show?

前端 未结 4 2032
情书的邮戳
情书的邮戳 2021-02-19 10:32

I\'m running exactly the same script.ps1 file in a Powershell ISE (manually loading the script and pressing F5) and in a Powershell console (executing the script file).

4条回答
  •  既然无缘
    2021-02-19 11:14

    Hmmm, the only major difference I can think of right off the top of my head is that the ISE uses single-threaded apartment (STA) mode in v2, and the console uses multi-threaded apartment (MTA). Have you tried running powershell.exe with the -STA argument, or powershell_ise.exe with -MTA, and trying the script again?

    It looks like the error is coming from the Git command you're trying to run, FWIW.

提交回复
热议问题