mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
* Create environmentVariables.yml * Update environmentVariables.yml * Delete environmentVariables.yml * Add new SoftwareReport generator * Output generation fixes after review * Add json output print in pipeline * Modify json output print in pipeline * Removed redundant space character
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)
|
|
)
|
|
}
|