=Fixed some errors in Setup-ScriptEnv

This commit is contained in:
Gal @Varonis Lab 2021-08-23 15:57:46 +00:00
parent 1b3a16806a
commit 50d9aef264
1 changed files with 3 additions and 3 deletions

View File

@ -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