mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
@@ -0,0 +1,73 @@
|
||||
function Get-VisualStudioVersion {
|
||||
$vsInstance = Get-VisualStudioInstance
|
||||
[PSCustomObject]@{
|
||||
Name = $vsInstance.DisplayName
|
||||
Version = $vsInstance.InstallationVersion
|
||||
Path = $vsInstance.InstallationPath
|
||||
}
|
||||
}
|
||||
|
||||
function Get-SDKVersion {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
($installedApplications | Where-Object { $_.DisplayName -eq 'Windows SDK' } | Select-Object -First 1).DisplayVersion
|
||||
}
|
||||
|
||||
function Get-WDKVersion {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
($installedApplications | Where-Object { $_.DisplayName -eq 'Windows Driver Kit' } | Select-Object -First 1).DisplayVersion
|
||||
}
|
||||
|
||||
function Get-VisualStudioExtensions {
|
||||
$vsPackages = (Get-VisualStudioInstance).Packages
|
||||
|
||||
# Additional vsixs
|
||||
$toolset = Get-ToolsetContent
|
||||
$vsixUrls = $toolset.visualStudio.vsix
|
||||
if ($vsixUrls)
|
||||
{
|
||||
$vsixs = $vsixUrls | ForEach-Object {
|
||||
$vsix = Get-VsixExtenstionFromMarketplace -ExtensionMarketPlaceName $_
|
||||
|
||||
$vsixVersion = ($vsPackages | Where-Object {$_.Id -match $vsix.VsixId -and $_.type -eq 'vsix'}).Version
|
||||
@{
|
||||
Package = $vsix.ExtensionName
|
||||
Version = $vsixVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# SDK
|
||||
$sdkVersion = Get-SDKVersion
|
||||
$sdkPackages = @(
|
||||
@{Package = 'Windows Software Development Kit'; Version = $sdkVersion}
|
||||
)
|
||||
|
||||
# WDK
|
||||
$wdkVersion = Get-WDKVersion
|
||||
$wdkExtensionVersion = Get-VSExtensionVersion -packageName 'Microsoft.Windows.DriverKit'
|
||||
$wdkPackages = @(
|
||||
@{Package = 'Windows Driver Kit'; Version = $wdkVersion}
|
||||
@{Package = 'Windows Driver Kit Visual Studio Extension'; Version = $wdkExtensionVersion}
|
||||
)
|
||||
|
||||
$extensions = @(
|
||||
$vsixs
|
||||
$ssdtPackages
|
||||
$sdkPackages
|
||||
$wdkPackages
|
||||
)
|
||||
|
||||
$extensions | Foreach-Object {
|
||||
[PSCustomObject]$_
|
||||
} | Select-Object Package, Version | Sort-Object Package
|
||||
}
|
||||
|
||||
function Get-WindowsSDKs {
|
||||
$path = "${env:ProgramFiles(x86)}\Windows Kits\10\Extension SDKs\WindowsDesktop"
|
||||
return [PSCustomObject]@{
|
||||
Path = $path
|
||||
Versions = $(Get-ChildItem $path).Name
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user