mirror of
https://github.com/actions/runner-images.git
synced 2025-12-28 04:38:53 +08:00
Update MongoDB and PostgreSQL documentation (#993)
* update mongodb and postgresql md * update pg service
This commit is contained in:
committed by
GitHub
parent
1810983a57
commit
52e3e704dd
@@ -0,0 +1,41 @@
|
||||
function Get-PostgreSQLMarkdown
|
||||
{
|
||||
$name = "PostgreSQL"
|
||||
$pgService = Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'"
|
||||
$pgPath = $pgService.PathName
|
||||
$pgRoot = $pgPath.split('"')[1].replace("\bin\pg_ctl.exe", "")
|
||||
$pgVersion = (pg_config --version).split()[1].Trim()
|
||||
$content = [PSCustomObject]@{
|
||||
Version = $pgVersion
|
||||
UserName = $env:PGUSER
|
||||
Password = $env:PGPASSWORD
|
||||
Path = $pgRoot
|
||||
ServiceName = $pgService.Name
|
||||
ServiceStatus = $pgService.State
|
||||
ServiceStartType = $pgService.StartMode
|
||||
} | New-MDTable
|
||||
|
||||
Build-MarkdownElement -Head $name -Content $content
|
||||
}
|
||||
|
||||
function Get-MongoDBMarkdown
|
||||
{
|
||||
$name = "MongoDB"
|
||||
$mongoService = Get-Service -Name $name
|
||||
$mongoVersion = (Get-Command -Name 'mongo').Version.ToString()
|
||||
$content = [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
|
||||
}
|
||||
@@ -2,13 +2,14 @@
|
||||
Install-Module MarkdownPS -Force -Scope AllUsers
|
||||
|
||||
Import-Module MarkdownPS
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.VisualStudio.psm1") -DisableNameChecking
|
||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
|
||||
|
||||
$markdown = ""
|
||||
|
||||
@@ -127,6 +128,10 @@ $markdown += New-MDHeader "Cached Tools" -Level 3
|
||||
$markdown += (Build-CachedToolsMarkdown)
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Databases" -Level 3
|
||||
$markdown += Build-DatabasesMarkdown
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$vs = Get-VisualStudioVersion
|
||||
$markdown += New-MDHeader "$($vs.Name)" -Level 3
|
||||
$markdown += $vs | New-MDTable
|
||||
|
||||
Reference in New Issue
Block a user