mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 11:07:02 +00:00
37 lines
1022 B
PowerShell
37 lines
1022 B
PowerShell
function Get-ApacheVersion {
|
|
$name = "httpd"
|
|
$port = 80
|
|
$version = brew list $name --versions | Take-Part -Part 1
|
|
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
|
$configFile = "$(brew --prefix)/etc/httpd/httpd.conf"
|
|
return [PsCustomObject]@{
|
|
"Name" = $name
|
|
"Version" = $version
|
|
"ConfigFile" = $configFile
|
|
"ServiceStatus" = $serviceStatus
|
|
"ListenPort" = $port
|
|
}
|
|
}
|
|
|
|
function Get-NginxVersion {
|
|
$name = "nginx"
|
|
$port = 80
|
|
$version = brew list $name --versions | Take-Part -Part 1
|
|
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
|
$configFile = "$(brew --prefix)/etc/nginx/nginx.conf"
|
|
return [PsCustomObject]@{
|
|
"Name" = $name
|
|
"Version" = $version
|
|
"ConfigFile" = $configFile
|
|
"ServiceStatus" = $serviceStatus
|
|
"ListenPort" = $port
|
|
}
|
|
}
|
|
|
|
function Build-WebServersSection {
|
|
return @(
|
|
(Get-ApacheVersion),
|
|
(Get-NginxVersion)
|
|
)
|
|
}
|