diff options
Diffstat (limited to 'coin')
-rw-r--r-- | coin/provisioning/common/windows/helpers.ps1 | 19 | ||||
-rw-r--r-- | coin/provisioning/common/windows/vc_redist.ps1 | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1 index 76ad4867..f5318bcb 100644 --- a/coin/provisioning/common/windows/helpers.ps1 +++ b/coin/provisioning/common/windows/helpers.ps1 @@ -159,3 +159,22 @@ function IsProxyEnabled { function Get-Proxy { return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').proxyServer } + +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 + } + } +} diff --git a/coin/provisioning/common/windows/vc_redist.ps1 b/coin/provisioning/common/windows/vc_redist.ps1 index f68846f0..1cd81a37 100644 --- a/coin/provisioning/common/windows/vc_redist.ps1 +++ b/coin/provisioning/common/windows/vc_redist.ps1 @@ -57,5 +57,4 @@ Download $externalUrl $internalUrl $package Verify-Checksum $package $sha1 Write-Host "Installing $package..." Run-Executable $package "/q" -Write-Host "Remove $package..." -Remove-Item -Force -Path $package +Remove $package |