Skip to content

Commit

Permalink
Merge pull request #279 from mlocati/win32/use-powershell-phpmanager-…
Browse files Browse the repository at this point in the history
…release-assets

Download release assets for PowerShell PhpManager
  • Loading branch information
shivammathur committed Sep 6, 2020
2 parents 83b3d4a + 56273e2 commit 83019fa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ Function Get-CleanPSProfile {

# Function to install PhpManager.
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 = "$bin_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 = "$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
Invoke-WebRequest -UseBasicParsing -Uri $release.assets[0].browser_download_url -OutFile $zip_file
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
}
Import-Module $module_path
Add-ToProfile $current_profile 'powershell-phpmanager' "Import-Module $module_path"
Expand Down

0 comments on commit 83019fa

Please sign in to comment.