mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
Implement new Pester Tests for Visual Studio (#1251)
* implement pester tests for visual studio * fix components list
This commit is contained in:
committed by
GitHub
parent
99bd7bf035
commit
532b49be6f
@@ -464,6 +464,36 @@ function Extract-7Zip {
|
||||
}
|
||||
}
|
||||
|
||||
function Get-VsCatalogJsonPath {
|
||||
$instanceFolder = Get-Item "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances\*" | Select-Object -First 1
|
||||
return Join-Path $instanceFolder.FullName "catalog.json"
|
||||
}
|
||||
|
||||
function Get-VisualStudioPath {
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Version,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Edition
|
||||
)
|
||||
|
||||
return "${env:ProgramFiles(x86)}\Microsoft Visual Studio\${Version}\${Edition}"
|
||||
}
|
||||
|
||||
function Get-VisualStudioPackages
|
||||
{
|
||||
$packagePath = "$env:ProgramData\Microsoft\VisualStudio\Packages\_Instances\*\state.packages.json"
|
||||
$instanceFolders = Get-ChildItem -Path $packagePath
|
||||
(Get-Content -Path $instanceFolders | ConvertFrom-Json).packages
|
||||
}
|
||||
|
||||
function Get-VisualStudioComponents {
|
||||
$vsPackages = Get-VisualStudioPackages | Where-Object type -in 'Component', 'Workload'
|
||||
$vsPackages | Sort-Object Id | Select-Object @{n = 'Package'; e = {$_.Id}} |
|
||||
Where-Object { $_.Package -notmatch "[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}" }
|
||||
}
|
||||
|
||||
function Install-AndroidSDKPackages {
|
||||
Param
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user