mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
@@ -0,0 +1,32 @@
|
||||
function Get-PostgreSQLTable
|
||||
{
|
||||
$pgService = Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'"
|
||||
$pgPath = $pgService.PathName
|
||||
$pgRoot = $pgPath.split('"')[1].replace("\bin\pg_ctl.exe", "")
|
||||
$env:Path += ";${env:PGBIN}"
|
||||
$pgVersion = (postgres --version).split()[2].Trim()
|
||||
|
||||
return @(
|
||||
[PSCustomObject]@{ Property = "ServiceName"; Value = $pgService.Name },
|
||||
[PSCustomObject]@{ Property = "Version"; Value = $pgVersion },
|
||||
[PSCustomObject]@{ Property = "ServiceStatus"; Value = $pgService.State },
|
||||
[PSCustomObject]@{ Property = "ServiceStartType"; Value = $pgService.StartMode },
|
||||
[PSCustomObject]@{ Property = "EnvironmentVariables"; Value = "`PGBIN=$env:PGBIN` <br> `PGDATA=$env:PGDATA` <br> `PGROOT=$env:PGROOT` " },
|
||||
[PSCustomObject]@{ Property = "Path"; Value = $pgRoot },
|
||||
[PSCustomObject]@{ Property = "UserName"; Value = $env:PGUSER },
|
||||
[PSCustomObject]@{ Property = "Password"; Value = $env:PGPASSWORD }
|
||||
)
|
||||
}
|
||||
|
||||
function Get-MongoDBTable
|
||||
{
|
||||
$name = "MongoDB"
|
||||
$mongoService = Get-Service -Name $name
|
||||
$mongoVersion = (Get-Command -Name 'mongo').Version.ToString()
|
||||
return [PSCustomObject]@{
|
||||
Version = $mongoVersion
|
||||
ServiceName = $name
|
||||
ServiceStatus = $mongoService.Status
|
||||
ServiceStartType = $mongoService.StartType
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user