Fix PHP8.0.x version in software report (#5653)

* Fix PHP8.0.x version in software report

* Remove hardcoded value for epoch

* Using updated regex to match epoch version
This commit is contained in:
Dusko Dobranic
2022-05-31 20:35:28 +02:00
committed by GitHub
parent fbbf35456f
commit 0fec5d8152

View File

@@ -236,7 +236,7 @@ function Get-SbtVersion {
function Get-PHPVersions {
$result = Get-CommandResult "apt list --installed" -Multiline
return $result.Output | Where-Object { $_ -match "^php\d+\.\d+/"} | ForEach-Object {
$_ -match "now (?<version>\d+\.\d+\.\d+)-" | Out-Null
$_ -match "now (\d+:)?(?<version>\d+\.\d+\.\d+)-" | Out-Null
$Matches.version
}
}