diff --git a/src/GraphDeployer/getRepository.ps1 b/src/GraphDeployer/getRepository.ps1 index e022d59857368f53453c28032c8620e1c648afe0..785cf083e3ad32e23fa8ce9c392e8a7ad00f005a 100644 --- a/src/GraphDeployer/getRepository.ps1 +++ b/src/GraphDeployer/getRepository.ps1 @@ -40,4 +40,8 @@ New-Item -ItemType Directory -Force -Path $path Copy-Item "./$repositoryFolder/*" $path -Recurse; +# Twice remove, because of: https://stackoverflow.com/questions/7909167/how-to-quietly-remove-a-directory-with-content-in-powershell#comment10316056_7909195 +If(Test-Path $repositoryFolder) { Remove-Item -LiteralPath $repositoryFolder -Force -Recurse } +If(Test-Path $repositoryFolder) { Remove-Item -LiteralPath $repositoryFolder -Force -Recurse } + Pop-Location \ No newline at end of file