Skip to content

Commit

Permalink
Suppress error in Get-Php run before PHP setup in win32.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 25, 2021
1 parent 345999b commit 92b4784
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ Step-Log "Setup PHP"
$installed = $null
if (Test-Path -LiteralPath $php_dir -PathType Container) {
try {
$installed = Get-Php -Path $php_dir
if(Test-Path $php_dir\php.ini) {
Rename-Item -Path $php_dir\php.ini -NewName 'php.ini.bak'
}
$installed = Get-Php -Path $php_dir -ErrorAction SilentlyContinue 2>$null 3>$null
if(Test-Path $php_dir\php.ini.bak) {
Rename-Item -Path $php_dir\php.ini.bak -NewName 'php.ini'
}
} catch { }
}
$status = "Installed"
Expand Down

0 comments on commit 92b4784

Please sign in to comment.