mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
make VS19ExtensionVersion function
This commit is contained in:
@@ -3,28 +3,7 @@
|
||||
## Desc: Validate the installation of the Windows Driver Kit
|
||||
################################################################################
|
||||
|
||||
function Get-WDKExtensionPackage {
|
||||
$vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
|
||||
$instanceFolders = Get-ChildItem -Path $vsProgramData.FullName
|
||||
|
||||
if($instanceFolders -is [array])
|
||||
{
|
||||
Write-Host "More than one instance installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$stateContent = Get-Content -Path ($instanceFolders.FullName + '\state.packages.json')
|
||||
$state = $stateContent | ConvertFrom-Json
|
||||
$WDKPackageVersion = ($state.packages | where { $_.id -eq "Microsoft.Windows.DriverKit" }).version
|
||||
|
||||
if (!$WDKPackageVersion)
|
||||
{
|
||||
Write-Host "WDK package for Visual studio was not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
return $WDKPackageVersion
|
||||
}
|
||||
Import-Module -Name ImageHelpers -Force
|
||||
|
||||
function Get-WDKVersion
|
||||
{
|
||||
@@ -40,7 +19,7 @@ function Get-WDKVersion
|
||||
}
|
||||
|
||||
$WDKVersion = Get-WDKVersion
|
||||
$WDKPackageVersion = Get-WDKExtensionPackage
|
||||
$WDKPackageVersion = Get-VS19ExtensionVersion -packageName "Microsoft.Windows.DriverKit"
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "Windows Driver Kit"
|
||||
|
||||
Reference in New Issue
Block a user