mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 17:45:22 +00:00
Prefer 7zip when installing Strawberry Perl (#6031)
Use a faster method to download and a faster method to extract zip archives, when available.
This commit is contained in:
parent
e571f1aa5a
commit
92f67a5f5b
@ -11,5 +11,15 @@
|
||||
#
|
||||
|
||||
# It does not seem that they have HTTPS: https://github.com/StrawberryPerl/strawberryperl.com/issues/11
|
||||
Invoke-WebRequest "http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-64bit.zip" -OutFile "$env:TEMP\strawberry_perl.zip"
|
||||
Expand-Archive "$env:TEMP\strawberry_perl.zip" -DestinationPath "C:\Strawberry" -Force
|
||||
(New-Object System.Net.WebClient).DownloadFile("http://strawberryperl.com/download/5.30.0.1/strawberry-perl-5.30.0.1-64bit.zip", "$env:TEMP\strawberry_perl.zip")
|
||||
|
||||
# Prefer 7zip if present, which is faster
|
||||
if (Get-Command 7z -errorAction SilentlyContinue)
|
||||
{
|
||||
7z x -oC:\Strawberry -y "$env:TEMP\strawberry_perl.zip"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Couldn't find 7zip, will use the slower Expand-Archive"
|
||||
Expand-Archive -Path "$env:TEMP\strawberry_perl.zip" -DestinationPath "C:\Strawberry" -Force
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user