diff options
author | Liang Qi <liang.qi@qt.io> | 2019-03-17 21:43:11 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-03-17 21:43:11 +0100 |
commit | 4978e6f835ef8778244e259bfa22c2e10450e9d5 (patch) | |
tree | c8d2e03abf4ab682b6a3524bad39cc55b6eb634b /coin/provisioning/common/windows/helpers.ps1 | |
parent | 5df387f9248bd1a1d3e0681c073a80de097f1341 (diff) | |
parent | 48ab1d879bc5dc1f65ee6671e546f58ae1c67bee (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
coin/provisioning/common/windows/helpers.ps1
Change-Id: If35fe38af7b7b1c4bba5009180fe51f37a90aa5c
Diffstat (limited to 'coin/provisioning/common/windows/helpers.ps1')
-rw-r--r-- | coin/provisioning/common/windows/helpers.ps1 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1 index 9cd8567e..5a7eb674 100644 --- a/coin/provisioning/common/windows/helpers.ps1 +++ b/coin/provisioning/common/windows/helpers.ps1 @@ -191,3 +191,22 @@ function Retry{ Throw("Failed to run command successfully in $retry_count tries") } } + +function Remove { + + Param ( + [string]$Path = $(BadParam("a path")) + ) + Write-Host "Removing $Path" + $i = 0 + While ( Test-Path($Path) ){ + Try{ + remove-item -Force -Recurse -Path $Path -ErrorAction Stop + }catch{ + $i +=1 + if ($i -eq 5) {exit 1} + Write-Verbose "$Path locked, trying again in 5" + Start-Sleep -seconds 5 + } + } +} |