Why is it that if you add -Verbose to a cmdlet that if it has a terminating error it does not stop executing the script while otherwise it would have?
For example, the following will fail with a PathNotFound error and the Start-Sleep 10 will never execute:
GCI -Path D:\BadPath\DoesNotExist.txt Start-Sleep 10
However, if I add -Verbose to the Get-ChildItem I get the same error but the Start-Sleep 10 does execute:
GCI -Path D:\BadPath\DoesNotExist.txt -Verbose Start-Sleep 10Is this expected behavior and if so is there a way to make the script terminate in the second scenario? I have also seen this behavior with Remove-Item.