1
0
mirror of https://github.com/coder/code-server.git synced 2024-12-04 23:03:06 +08:00
code-server/lib/vscode/build/azure-pipelines/win32/retry.ps1
2021-02-09 16:08:37 +00:00

20 lines
230 B
PowerShell

function Retry
{
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd
)
$retry = 0
while ($retry++ -lt 3) {
try {
& $cmd
return
} catch {
# noop
}
}
throw "Max retries reached"
}