Overwrite existing PHP on windows

This commit is contained in:
Shivam Mathur 2019-10-22 21:58:30 +05:30
parent b132b4eb7c
commit 3315fa09dc
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -30,12 +30,7 @@ if($installed -ne $version) {
if($version -lt '7.0') {
Install-Module -Name VcRedist -Force
}
Uninstall-Php C:\tools\php
Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path C:\tools\php$version -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
(Get-PhpSwitcher).targets
Initialize-PhpSwitcher -Alias C:\tools\php -Scope CurrentUser -Force
Add-PhpToSwitcher -Name $version -Path C:\tools\php$version -Force
Switch-Php $version -Force
Install-Php -Version $version -Architecture x86 -ThreadSafe $true -InstallVC -Path C:\tools\php -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
$status = "Installed PHP$version"
}