mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Use Invoke-RestMethod to get tag
This commit is contained in:
parent
3f4c1842a0
commit
da7361cc8f
@ -23,8 +23,7 @@ Function Add-Log($mark, $subject, $message) {
|
|||||||
Function Install-PhpManager() {
|
Function Install-PhpManager() {
|
||||||
$repo = "mlocati/powershell-phpmanager"
|
$repo = "mlocati/powershell-phpmanager"
|
||||||
$zip_file = "$php_dir\PhpManager.zip"
|
$zip_file = "$php_dir\PhpManager.zip"
|
||||||
$tags = Invoke-WebRequest https://api.github.com/repos/$repo/tags | ConvertFrom-Json
|
$tag = (Invoke-RestMethod https://api.github.com/repos/$repo/tags)[0].Name
|
||||||
$tag = $tags[0].Name
|
|
||||||
$module_path = "$php_dir\PhpManager\powershell-phpmanager-$tag\PhpManager"
|
$module_path = "$php_dir\PhpManager\powershell-phpmanager-$tag\PhpManager"
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file
|
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file
|
||||||
Expand-Archive -Path $zip_file -DestinationPath $php_dir\PhpManager
|
Expand-Archive -Path $zip_file -DestinationPath $php_dir\PhpManager
|
||||||
|
Loading…
Reference in New Issue
Block a user