diff --git a/Setup-ScriptEnv.ps1 b/Setup-ScriptEnv.ps1 index 837f707..64c623b 100644 --- a/Setup-ScriptEnv.ps1 +++ b/Setup-ScriptEnv.ps1 @@ -370,14 +370,14 @@ function _Init { git pull } elseif ( $PSCmdlet.ShouldProcess("Pull git repo from $GitURL into $MyPSScriptRoot ?") ) { $local:tmpGitDir = New-TemporaryFile - Remove-Item $tmpGitDir + Remove-Item $tmpGitDir -Confirm:$flase -Force New-Item -Type Directory $tmpGitDir.FullName | Out-Null Write-Verbose "Cloning git repo [$GitURL] into temporary location ('$($tmpGitDir.FullName)')..." $local:GitOutput = "$(& git clone $GitURL $tmpGitDir.FullName --no-checkout)" Write-Verbose $GitOutput Write-Verbose "Moving git repo from temp location to $MyPSScriptRoot . . ." - Copy-Item -Recurse (Join-Path $tmpGitDir.FullName .git) ./.git - Remove-Item $tmpGitDir.FullName + Copy-Item -Force -Recurse (Join-Path $tmpGitDir.FullName .git) ./.git + Remove-Item $tmpGitDir.FullName -Recurse -Force -Confirm:$false Write-Verbose "Checking out repo..." $GitOutput = "$(& git checkout --force)" Write-Verbose $GitOutput