Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
# try/catch/fix and continue
$tries = 0
while ($tries -lt 2) {
try {
$tries++
$ErrorActionPreference='Stop'
# code I am testing goes here - perhaps with a param argument that needs changing
$tries++
}
catch {
#fixup code goes here
$ErrorActionPreference='SilentlyContinue' # and the loop will now retry.
}
}