[Linux] Minor documentation improvements (#6749)

This commit is contained in:
Maxim Lobanov
2022-12-13 17:07:05 +01:00
committed by GitHub
parent 6033af8dd1
commit e63632f872
9 changed files with 74 additions and 129 deletions

View File

@@ -76,16 +76,13 @@ function Get-ErlangRebar3Version {
function Get-MonoVersion {
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
$aptSourceRepo = Get-AptSourceRepository -PackageName "mono"
return "Mono $monoVersion (apt source repository: $aptSourceRepo)"
return "Mono $monoVersion"
}
function Get-MsbuildVersion {
$msbuildVersion = msbuild -version | Select-Object -Last 1
$result = Select-String -Path (Get-Command msbuild).Source -Pattern "msbuild"
$result -match "(?<path>\/\S*\.dll)" | Out-Null
$msbuildPath = $Matches.path
return "MSBuild $msbuildVersion (from $msbuildPath)"
$monoVersion = Get-MonoVersion
return "MSBuild $msbuildVersion ($monoVersion)"
}
function Get-NuGetVersion {
@@ -210,11 +207,8 @@ function Get-Pip3Version {
}
function Get-VcpkgVersion {
$result = Get-CommandResult "vcpkg version"
$result.Output -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
$vcpkgVersion = $Matches.version
$commitId = git -C "/usr/local/share/vcpkg" rev-parse --short HEAD
return "Vcpkg $vcpkgVersion (build from master \<$commitId>)"
return "Vcpkg (build from commit $commitId)"
}
function Get-AntVersion {
@@ -261,31 +255,14 @@ function Get-PHPUnitVersion {
return $Matches.version
}
function Build-PHPTable {
$php = @{
"Tool" = "PHP"
"Version" = "$(Get-PHPVersions -Join '<br>')"
}
$composer = @{
"Tool" = "Composer"
"Version" = Get-ComposerVersion
}
$phpunit = @{
"Tool" = "PHPUnit"
"Version" = Get-PHPUnitVersion
}
return @($php, $composer, $phpunit) | ForEach-Object {
[PSCustomObject] @{
"Tool" = $_.Tool
"Version" = $_.Version
}
}
}
function Build-PHPSection {
$output = ""
$output += New-MDHeader "PHP" -Level 3
$output += Build-PHPTable | New-MDTable
$output += New-MDHeader "PHP Tools" -Level 3
$output += New-MDList -Style Unordered -Lines @(
"PHP: $((Get-PHPVersions) -join ', ')",
"Composer $(Get-ComposerVersion)",
"PHPUnit $(Get-PHPUnitVersion)"
)
$output += New-MDCode -Lines @(
"Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled."
)
@@ -327,23 +304,30 @@ function Get-AzModuleVersions {
}
function Get-PowerShellModules {
$modules = (Get-ToolsetContent).powershellModules.name
[Array] $result = @()
$psModules = Get-Module -Name $modules -ListAvailable | Sort-Object Name | Group-Object Name
$psModules | ForEach-Object {
$moduleName = $_.Name
$moduleVersions = ($_.group.Version | Sort-Object -Unique) -join '<br>'
[PSCustomObject]@{
Module = $moduleName
Version = $moduleVersions
}
[Array] $azureInstalledModules = Get-ChildItem -Path "/usr/share/az_*" -Directory | ForEach-Object { $_.Name.Split("_")[1] }
if ($azureInstalledModules.Count -gt 0) {
$result += "Az: $($azureInstalledModules -join ', ')"
}
[Array] $azureCachedModules = Get-ChildItem /usr/share/az_*.zip -File | ForEach-Object { $_.Name.Split("_")[1] }
if ($azureCachedModules.Count -gt 0) {
$result += "Az (Cached): $($azureCachedModules -join ', ')"
}
$result += (Get-ToolsetContent).powershellModules.name | ForEach-Object {
$moduleName = $_
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
return "$($moduleName): $($moduleVersions -join ', ')"
}
return $result
}
function Get-DotNetCoreSdkVersions {
$unsortedDotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 }
$dotNetCoreSdkVersion = $unsortedDotNetCoreSdkVersion -join " "
$dotNetCoreSdkVersion = $unsortedDotNetCoreSdkVersion -join ", "
return $dotNetCoreSdkVersion
}