mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 15:57:17 +00:00
[Ubuntu] Implement new directories hierarchy (#8627)
This commit is contained in:
committed by
GitHub
parent
d1f2c9a3be
commit
5d40b1e213
17
images/ubuntu/scripts/docs-gen/SoftwareReport.Java.psm1
Normal file
17
images/ubuntu/scripts/docs-gen/SoftwareReport.Java.psm1
Normal file
@@ -0,0 +1,17 @@
|
||||
function Get-JavaVersionsTable {
|
||||
$javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] }
|
||||
|
||||
return $javaToolcacheVersions | ForEach-Object {
|
||||
$majorVersion = $_.Name.split(".")[0]
|
||||
$fullVersion = $_.Name.Replace("-", "+")
|
||||
$defaultJavaPath = $env:JAVA_HOME
|
||||
$javaPath = Get-Item env:JAVA_HOME_${majorVersion}_X64
|
||||
|
||||
$defaultPostfix = ($javaPath.Value -eq $defaultJavaPath) ? " (default)" : ""
|
||||
|
||||
[PSCustomObject] @{
|
||||
"Version" = $fullVersion + $defaultPostfix
|
||||
"Environment Variable" = $javaPath.Name
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user