diff --git a/PwshSpectreConsole/Build.ps1 b/PwshSpectreConsole/Build.ps1 index fa1663a7..c0f017b5 100644 --- a/PwshSpectreConsole/Build.ps1 +++ b/PwshSpectreConsole/Build.ps1 @@ -7,6 +7,9 @@ function Install-SpectreConsole { [string] $InstallLocation, [string] $Version ) + + New-Item -Path $libPath -ItemType "Directory" -Force | Out-Null + $libPath = Join-Path $InstallLocation "Spectre.Console" New-Item -Path $libPath -ItemType "Directory" -Force | Out-Null $downloadLocation = Join-Path $libPath "download.zip" @@ -35,5 +38,7 @@ function Install-SpectreConsole { Write-Host "Downloading Spectre.Console version $Version" $installLocation = (Join-Path $PSScriptRoot "packages") -Remove-Item $installLocation -Recurse -Force +if(Test-Path $installLocation) { + Remove-Item $installLocation -Recurse -Force +} Install-SpectreConsole -InstallLocation $installLocation -Version $Version \ No newline at end of file