[Windows] Update zstd to 1.4.9 (#2899)

* install from GitHub releases

* rename zstd folder

* change wildcard

* cut messages
This commit is contained in:
Aleksandr Chebotov
2021-03-12 14:28:18 +03:00
committed by GitHub
parent 24abe31369
commit 2f03a07621

View File

@@ -3,6 +3,17 @@
## Desc: Install zstd
################################################################################
Choco-Install -PackageName zstandard
$url = "https://api.github.com/repos/facebook/zstd/releases/latest"
# Explicitly set type to string since match returns array by default
[System.String] $zstdLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "zstd-.+-win64.zip$"
$zstdArchivePath = Start-DownloadWithRetry -Url $zstdLatest -Name "zstd-win64.zip"
$toolPath = "C:\tools"
$zstdPath = Join-Path $toolPath zstd
Extract-7Zip -Path $zstdArchivePath -DestinationPath $toolPath
Move-Item -Path "${zstdPath}*" -Destination $zstdPath
# Add zstd-win64 to PATH
Add-MachinePathItem $zstdPath
Invoke-PesterTests -TestFile "Tools" -TestName "Zstd"