mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
Refactor Get-DotnetFrameworkTools and allow multiple SDKs installation (#5464)
This commit is contained in:
@@ -226,15 +226,14 @@ function Get-DotnetRuntimes {
|
|||||||
|
|
||||||
function Get-DotnetFrameworkTools {
|
function Get-DotnetFrameworkTools {
|
||||||
$path = "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows\*\*\NETFX*"
|
$path = "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows\*\*\NETFX*"
|
||||||
$frameworkVersions = @()
|
Get-ChildItem -Path $path -Directory | Group-Object {
|
||||||
Get-ChildItem -Path $path -Directory | ForEach-Object {
|
$_.Fullname -Replace " \d+\.\d+(\.\d+)?", " <version>"
|
||||||
$frameworkVersions += ($_.Name -Split(" "))[1]
|
} | ForEach-Object {
|
||||||
$frameworkPath = $_.Fullname -Replace " \d+\.\d+(\.\d+)?", " <version>"
|
|
||||||
}
|
|
||||||
[PSCustomObject]@{
|
[PSCustomObject]@{
|
||||||
Versions = $frameworkVersions -Join " "
|
Versions = $_.Group.Name | ForEach-Object { $_.Split(" ")[1] }
|
||||||
Path = $frameworkPath
|
Path = $_.Name
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PowerShellAzureModules {
|
function Get-PowerShellAzureModules {
|
||||||
|
|||||||
@@ -267,12 +267,15 @@ Get-DotnetRuntimes | Foreach-Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$markdown += New-MDHeader ".NET Framework" -Level 3
|
$markdown += New-MDHeader ".NET Framework" -Level 3
|
||||||
$frameworks = Get-DotnetFrameworkTools
|
|
||||||
$markdown += "``Type: Developer Pack``"
|
$markdown += "``Type: Developer Pack``"
|
||||||
$markdown += New-MDNewLine
|
$markdown += New-MDNewLine
|
||||||
$markdown += "``Location $($frameworks.Path)``"
|
Get-DotnetFrameworkTools | Foreach-Object {
|
||||||
$markdown += New-MDNewLine
|
$path = $_.Path
|
||||||
$markdown += New-MDList -Lines $frameworks.Versions -Style Unordered
|
$versions = $_.Versions
|
||||||
|
$markdown += "``Location: $path``"
|
||||||
|
$markdown += New-MDNewLine
|
||||||
|
$markdown += New-MDList -Lines $versions -Style Unordered
|
||||||
|
}
|
||||||
|
|
||||||
$markdown += New-MDHeader ".NET tools" -Level 3
|
$markdown += New-MDHeader ".NET tools" -Level 3
|
||||||
$tools = Get-DotnetTools
|
$tools = Get-DotnetTools
|
||||||
|
|||||||
@@ -103,8 +103,7 @@ Describe "GoogleCloudSDK" -Skip:(Test-IsWin22) {
|
|||||||
|
|
||||||
Describe "NET48" {
|
Describe "NET48" {
|
||||||
It "NET48" {
|
It "NET48" {
|
||||||
$netPath = (Get-DotnetFrameworkTools).Path.Split("<")[0]
|
(Get-DotnetFrameworkTools).Versions | Should -Contain "4.8"
|
||||||
${netPath} + "4.8 Tools" | Should -Exist
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user