Merge pull request #716 from pwnb0y/master

install.ps1 is modified to increase downloading speed as well as show progress bar
This commit is contained in:
David Wertenteil
2023-01-05 08:28:47 +02:00
committed by GitHub

View File

@@ -12,7 +12,17 @@ $fullUrl = $url + $packageName
New-Item -Path $BASE_DIR -ItemType "directory" -ErrorAction SilentlyContinue
# Download the binary
Invoke-WebRequest -Uri $fullUrl -OutFile $BASE_DIR\kubescape.exe
$useBitTransfer = $null -ne (Get-Module -Name BitsTransfer -ListAvailable) -and ($PSVersionTable.PSVersion.Major -le 5)
if ($useBitTransfer)
{
Write-Information -MessageData 'Using a fallback BitTransfer method since you are running Windows PowerShell'
Start-BitsTransfer -Source $fullUrl -Destination $BASE_DIR\kubescape.exe
}
else
{
Invoke-WebRequest -Uri $fullUrl -OutFile $BASE_DIR\kubescape.exe
}
# Update user PATH if needed
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")