Все, что я читаю в Интернете, говорит мне, что Write-Error записывает в поток ошибок, но не завершает сценарий, и все же, когда следующий сценарий выполняется, он четко делает завершить сценарий.
Write-Error "This should not terminate the script..."
Write-Information "... and it hasn't"
Вывод:
D:\MyBitsAndBobs\writeerrortest.ps1 : This should not terminate the script...
At D:\MyBitsAndBobs\writeerrortest.ps1:3 char:1
+ Write-Error "This should not terminate the script..."
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,writeerrortest.ps1
Сообщение ".. а это не так" явно никогда не выполняется. Кто-нибудь может пролить свет на это, по-видимому, неожиданное поведение?