PowerShell try/catch Is Not Catching Your Error
Most cmdlet errors are non-terminating, so try/catch never sees them. Why -ErrorAction Stop is the whole trick, why Write-Error is not throw, and why try/catch does nothing at all for robocopy or git.
Most cmdlet errors are non-terminating, so try/catch never sees them. Why -ErrorAction Stop is the whole trick, why Write-Error is not throw, and why try/catch does nothing at all for robocopy or git.