[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:
Dibir Magomedsaygitov
2020-07-28 18:07:31 +03:00
committed by GitHub
parent b7c69ef560
commit b0a922fa52
2 changed files with 9 additions and 18 deletions

View File

@@ -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 {
$vsVersion = vswhere -format json | ConvertFrom-Json
[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 {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
@@ -36,7 +23,7 @@ function Get-VisualStudioExtensions {
# Wix
$vs = (Get-VisualStudioVersion).Name.Split()[-1]
$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
$wdkPackageVersion = Get-VSExtensionVersion -packageName 'Microsoft.Windows.DriverKit'