Files
runner-images/images/macos/scripts/docs-gen/SoftwareReport.Toolcache.psm1
T

44 lines
1.6 KiB
PowerShell
Raw Normal View History

2020-09-10 14:34:08 +03:00
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
function Get-ToolcacheRubyVersions {
$toolcachePath = Join-Path $env:HOME "hostedtoolcache" "Ruby"
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
}
function Get-ToolcachePythonVersions {
$toolcachePath = Join-Path $env:HOME "hostedtoolcache" "Python"
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
}
function Get-ToolcacheNodeVersions {
$toolcachePath = Join-Path $env:HOME "hostedtoolcache" "Node"
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
}
function Get-ToolcacheGoVersions {
$toolcachePath = Join-Path $env:HOME "hostedtoolcache" "Go"
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
2020-09-10 14:34:08 +03:00
}
function Build-ToolcacheSection {
$nodes = @()
$nodes += @(
[ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List")
[ToolVersionsListNode]::new("Python", $(Get-ToolcachePythonVersions), '^\d+\.\d+', "List"),
[ToolVersionsListNode]::new("Node.js", $(Get-ToolcacheNodeVersions), '^\d+', "List"),
[ToolVersionsListNode]::new("Go", $(Get-ToolcacheGoVersions), '^\d+\.\d+', "List")
)
return $nodes
2020-09-10 14:34:08 +03:00
}
function Get-PowerShellModules {
2023-12-04 12:13:08 +01:00
$modules = ((Get-ToolsetContent).powershellModules).name
$modules | ForEach-Object {
$moduleName = $_
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
return [ToolVersionsListNode]::new($moduleName, $moduleVersions, '^\d+', "Inline")
2020-09-10 14:34:08 +03:00
}
}