
Try to avoid setting flags:
““
Try {
$continue = $true
Do-Something -ErrorAction Stop
} Catch {
$continue = $false
}
if ($continue) {
Do-This
Set-That
Get-Those
}
Instead, put the entire "transaction" into the Try block:
Try {
Do-Something -ErrorAction Stop
Do-This
Set-That
Get-Those
} Catch {
Handle-Error
}
““
It’s a lot easier to follow the logic.
Describe what you're looking for in as much detail as you'd like.
Our AI reads your request and finds the best matching books for you.
Popular searches:
Join 2 million readers and get unlimited free ebooks