From 12b1061a6bb9aa6a0464fd1bff57f644276744c6 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 15 Oct 2020 09:01:16 +0200 Subject: [PATCH] Perform only one URL call to download latest PhpManager.zip asset --- src/scripts/win32.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index c7e1d567..63c8e366 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -59,9 +59,8 @@ Function Add-Printf { Function Install-PhpManager() { $module_path = "$php_dir\PhpManager\PhpManager.psm1" if(-not (Test-Path $module_path -PathType Leaf)) { - $release = Invoke-RestMethod https://api.github.com/repos/mlocati/powershell-phpmanager/releases/latest $zip_file = "$php_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 $php_dir -Force } Import-Module $module_path