mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[Windows] Add back to documentation versions of Visual Studio Components (#1304)
* fix software report for visual studio extensions * resolve conflicts * fix issue with vs components * refactor code * add fliter to components extracting
This commit is contained in:
committed by
GitHub
parent
b7c69ef560
commit
b0a922fa52
@@ -69,8 +69,12 @@ function Get-VisualStudioPath {
|
|||||||
return (Get-VSSetupInstance | Select-VSSetupInstance -Product *).InstallationPath
|
return (Get-VSSetupInstance | Select-VSSetupInstance -Product *).InstallationPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-VisualStudioPackages {
|
||||||
|
return (Get-VSSetupInstance | Select-VSSetupInstance -Product *).Packages
|
||||||
|
}
|
||||||
|
|
||||||
function Get-VisualStudioComponents {
|
function Get-VisualStudioComponents {
|
||||||
$vsPackages = (Get-VSSetupInstance | Select-VSSetupInstance -Product *).Packages.Id
|
Get-VisualStudioPackages | Where-Object type -in 'Component', 'Workload' |
|
||||||
$vsPackages | Select-Object @{n = 'Package'; e = {$_}} |
|
Sort-Object Id, Version | Select-Object @{n = 'Package'; e = {$_.Id}}, Version |
|
||||||
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}" }
|
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}" }
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,3 @@
|
|||||||
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-VisualStudioVersion {
|
function Get-VisualStudioVersion {
|
||||||
$vsVersion = vswhere -format json | ConvertFrom-Json
|
$vsVersion = vswhere -format json | ConvertFrom-Json
|
||||||
[PSCustomObject]@{
|
[PSCustomObject]@{
|
||||||
@@ -14,12 +7,6 @@ function Get-VisualStudioVersion {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-VisualStudioComponents {
|
|
||||||
$vsPackages = Get-VisualStudioPackages | Where-Object type -in 'Component', 'Workload'
|
|
||||||
$vsPackages | Sort-Object Id, Version | Select-Object @{n = 'Package'; e = {$_.Id}}, Version |
|
|
||||||
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 Get-WixVersion {
|
function Get-WixVersion {
|
||||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||||
$installedApplications = Get-ItemProperty -Path $regKey
|
$installedApplications = Get-ItemProperty -Path $regKey
|
||||||
@@ -36,7 +23,7 @@ function Get-VisualStudioExtensions {
|
|||||||
# Wix
|
# Wix
|
||||||
$vs = (Get-VisualStudioVersion).Name.Split()[-1]
|
$vs = (Get-VisualStudioVersion).Name.Split()[-1]
|
||||||
$wixPackageVersion = Get-WixVersion
|
$wixPackageVersion = Get-WixVersion
|
||||||
$wixExtensionVersion = (Get-VisualStudioPackages | Where-Object {$_.id -match 'WixToolset.VisualStudioExtension.Dev' -and $_.type -eq 'vsix'}).Version
|
$wixExtensionVersion = (Get-VisualStudioPackages | Where-Object {$_.Id -match 'WixToolset.VisualStudioExtension.Dev' -and $_.type -eq 'vsix'}).Version
|
||||||
|
|
||||||
# WDK
|
# WDK
|
||||||
$wdkPackageVersion = Get-VSExtensionVersion -packageName 'Microsoft.Windows.DriverKit'
|
$wdkPackageVersion = Get-VSExtensionVersion -packageName 'Microsoft.Windows.DriverKit'
|
||||||
|
|||||||
Reference in New Issue
Block a user