install.ps1 is modified

This commit is contained in:
pwnb0y
2022-08-29 11:25:29 +05:30
parent c7e1e251ba
commit 4d155a6b4f
+11 -1
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")