16
AUG
The simplest way to retry in PowerShell
$attempt = 0 do { try { Do something that has a high possiblity to crash. ping a if ( not $LASTEXITCODE) { $success = $true } else { throw "Transient error. LASTEXITCODE is $LASTEXITCODE." } } catch { if ($attempt eq 5) { You can do some extra logging here. Write Error "Task fail...
Views 2,088