From da7361cc8f3c414df79b83ffe784c7067b11f86e Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 27 May 2020 08:02:21 +0530 Subject: [PATCH] Use Invoke-RestMethod to get tag --- 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 ba0ce524..91f44996 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -23,8 +23,7 @@ Function Add-Log($mark, $subject, $message) { Function Install-PhpManager() { $repo = "mlocati/powershell-phpmanager" $zip_file = "$php_dir\PhpManager.zip" - $tags = Invoke-WebRequest https://api.github.com/repos/$repo/tags | ConvertFrom-Json - $tag = $tags[0].Name + $tag = (Invoke-RestMethod https://api.github.com/repos/$repo/tags)[0].Name $module_path = "$php_dir\PhpManager\powershell-phpmanager-$tag\PhpManager" Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file Expand-Archive -Path $zip_file -DestinationPath $php_dir\PhpManager