mirror of
https://github.com/actions/runner-images.git
synced 2025-12-24 02:20:20 +08:00
Add VS build tools installation for Windows (#1533)
* add VS build tools installation, tests, reports, made minor changes to current VS install helper functions * Vstype typo * removed unused variable * validate set for new functions * some variable names clarifications * test parameter error * style and syntax improvments * syntax notation Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
@@ -258,34 +258,6 @@ function Install-VsixExtension
|
||||
}
|
||||
}
|
||||
|
||||
function Get-VSExtensionVersion
|
||||
{
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string] $packageName
|
||||
)
|
||||
|
||||
$instanceFolders = Get-ChildItem -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
|
||||
if ($instanceFolders -is [array])
|
||||
{
|
||||
Write-Host "More than one instance installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$stateContent = Get-Content -Path (Join-Path $instanceFolders.FullName '\state.packages.json')
|
||||
$state = $stateContent | ConvertFrom-Json
|
||||
$packageVersion = ($state.packages | Where-Object { $_.id -eq $packageName }).version
|
||||
|
||||
if (-not $packageVersion)
|
||||
{
|
||||
Write-Host "installed package $packageName for Visual Studio 2019 was not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
return $packageVersion
|
||||
}
|
||||
|
||||
function Get-ToolcachePackages
|
||||
{
|
||||
$toolcachePath = Join-Path $env:ROOT_FOLDER "toolcache.json"
|
||||
|
||||
Reference in New Issue
Block a user