[Windows] Implement new directories hierarchy (#8616)

This commit is contained in:
Vasilii Polikarpov
2023-11-15 11:24:45 +01:00
committed by GitHub
parent 84a7deae24
commit d1f2c9a3be
165 changed files with 1146 additions and 1139 deletions

View File

@@ -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
}
}