mirror of
https://github.com/danog/code-server.git
synced 2024-12-15 10:47:12 +01:00
e4a830e9b7
20 lines
230 B
PowerShell
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"
|
|||
}
|