diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 3fb254d8..8d40b9b6 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -44,13 +44,12 @@ Function Add-ToProfile { } Function Install-PhpManager() { - $repo = "mlocati/powershell-phpmanager" - $tag = (Invoke-RestMethod https://api.github.com/repos/$repo/releases/latest).tag_name - $module_path = "$bin_dir\PhpManager\powershell-phpmanager-$tag\PhpManager\PhpManager.psm1" + $module_path = "$php_dir\PhpManager\PhpManager.psm1" if(-not (Test-Path $module_path -PathType Leaf)) { - $zip_file = "$bin_dir\PhpManager.zip" - Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file - Expand-Archive -Path $zip_file -DestinationPath $bin_dir\PhpManager -Force + $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 + Expand-Archive -Path $zip_file -DestinationPath $php_dir -Force } Import-Module $module_path Add-ToProfile $current_profile 'powershell-phpmanager' "Import-Module $module_path"