mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Update documentation generation to use shared software report module (#6834)
This commit is contained in:
committed by
GitHub
parent
f7f519dcc4
commit
447c8387a2
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user