[Windows] Update documentation generation to use shared software report module (#6834)

This commit is contained in:
bogdan-damian-bgd
2022-12-30 10:24:22 +01:00
committed by GitHub
parent f7f519dcc4
commit 447c8387a2
10 changed files with 349 additions and 535 deletions

View File

@@ -1,13 +1,12 @@
function Get-PostgreSQLMarkdown
function Get-PostgreSQLTable
{
$name = "PostgreSQL"
$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()
$content = @(
return @(
[PSCustomObject]@{ Property = "ServiceName"; Value = $pgService.Name },
[PSCustomObject]@{ Property = "Version"; Value = $pgVersion },
[PSCustomObject]@{ Property = "ServiceStatus"; Value = $pgService.State },
@@ -16,29 +15,18 @@ function Get-PostgreSQLMarkdown
[PSCustomObject]@{ Property = "Path"; Value = $pgRoot },
[PSCustomObject]@{ Property = "UserName"; Value = $env:PGUSER },
[PSCustomObject]@{ Property = "Password"; Value = $env:PGPASSWORD }
) | New-MDTable
Build-MarkdownElement -Head $name -Content $content
)
}
function Get-MongoDBMarkdown
function Get-MongoDBTable
{
$name = "MongoDB"
$mongoService = Get-Service -Name $name
$mongoVersion = (Get-Command -Name 'mongo').Version.ToString()
$content = [PSCustomObject]@{
return [PSCustomObject]@{
Version = $mongoVersion
ServiceName = $name
ServiceStatus = $mongoService.Status
ServiceStartType = $mongoService.StartType
} | New-MDTable
Build-MarkdownElement -Head $name -Content $content
}
}
function Build-DatabasesMarkdown
{
$markdown = ""
$markdown += Get-PostgreSQLMarkdown
$markdown += Get-MongoDBMarkdown
$markdown
}