fix: fix installation build in powershell (windows)

New-TemporaryFile doesn't work in cmd
More info: https://github.com/PowerShell/PowerShell/issues/14100
This commit is contained in:
khoind4 2024-11-22 14:32:17 +07:00 committed by Hanchin Hsieh
parent 341ecd2073
commit 934602b2a6

View File

@ -56,7 +56,7 @@ function Download-Prebuilt($feature) {
} }
# Download and extract the artifact # Download and extract the artifact
$TempFile = New-TemporaryFile | Rename-Item -NewName { $_.Name + ".zip" } -PassThru $TempFile = Get-Item ([System.IO.Path]::GetTempFilename()) | Rename-Item -NewName { $_.Name + ".zip" } -PassThru
Invoke-WebRequest -Uri $ARTIFACT_URL -OutFile $TempFile Invoke-WebRequest -Uri $ARTIFACT_URL -OutFile $TempFile
Expand-Archive -Path $TempFile -DestinationPath $TARGET_DIR -Force Expand-Archive -Path $TempFile -DestinationPath $TARGET_DIR -Force
Remove-Item $TempFile Remove-Item $TempFile