Почему Powershell ISE показывает ошибки, которые не отображает консоль Powershell?

Я запускаю точно такой же файл script.ps1 в ISE Powershell (загрузка сценария вручную и нажатие клавиши F5) и в консоли Powershell (выполнение файла сценария).They both work but ISE shows errors that the console does not. Why?

Код является:

git push origin master
Write-Host "lastExitCode: $lastExitCode Last command was successful: $?"

Этот код выводит эту ошибку в ISE:

git.cmd : Initializing to normal mode
At E:\script.ps1:28 char:4
+ git <<<<  push origin master
    + CategoryInfo          : NotSpecified: (Initializing to normal mode:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Initializing to normal mode

Everything up-to-date

lastExitCode: 0 Last command was successful: False

И это в консоли:

Everything up-to-date
lastExitCode: 0 Last command was successful: True

Вы можете видеть, что статус успеха не то же самое.

Ответы на вопрос(4)

Ваш ответ на вопрос