mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Perform only one URL call to download latest PhpManager.zip asset
This commit is contained in:
parent
eaaab1cec3
commit
eb07280d5c
@ -91,9 +91,8 @@ Function Get-CleanPSProfile {
|
|||||||
Function Install-PhpManager() {
|
Function Install-PhpManager() {
|
||||||
$module_path = "$bin_dir\PhpManager\PhpManager.psm1"
|
$module_path = "$bin_dir\PhpManager\PhpManager.psm1"
|
||||||
if(-not (Test-Path $module_path -PathType Leaf)) {
|
if(-not (Test-Path $module_path -PathType Leaf)) {
|
||||||
$release = Invoke-RestMethod https://api.github.com/repos/mlocati/powershell-phpmanager/releases/latest
|
|
||||||
$zip_file = "$bin_dir\PhpManager.zip"
|
$zip_file = "$bin_dir\PhpManager.zip"
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $release.assets[0].browser_download_url -OutFile $zip_file
|
Invoke-WebRequest -UseBasicParsing -Uri 'https://github.com/mlocati/powershell-phpmanager/releases/latest/download/PhpManager.zip' -OutFile $zip_file
|
||||||
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
|
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
|
||||||
}
|
}
|
||||||
Import-Module $module_path
|
Import-Module $module_path
|
||||||
|
Loading…
Reference in New Issue
Block a user