I'm writing a PowerShell script with a try-catch that calls a bunch of functions.
function A {
# exceptions here won't trigger the catch
}
function B {}
try {
# exceptions here will trigger the catch
A
B
} catch {
# handle errors
}
How do I get the functions to throw the exceptions upstream by default without writing a try catch block inside every functions?