mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 05:48:07 +00:00
[Windows] Install vsix extensions using CDN endpoint (#3244)
* Install extensions for VS19 * Get vsix packages name in runtime * add a bit of debug * Get extension id from the marketplace uri * Add extension name * skip vcredist installation * Add Get-VsixExtenstionFromMarketplace to ImageHelpers.psm1 * Fix DownloadUri name in the function * DownloadUri in lower case * Add packages to the readme * Add a condition to software report * fix spelling in function * Simplify toolset + get rid of backticks
This commit is contained in:
@@ -198,6 +198,33 @@ function Start-DownloadWithRetry
|
||||
return $filePath
|
||||
}
|
||||
|
||||
function Get-VsixExtenstionFromMarketplace {
|
||||
Param
|
||||
(
|
||||
[string] $ExtensionMarketPlaceName,
|
||||
[string] $MarketplaceUri = "https://marketplace.visualstudio.com/items?itemName="
|
||||
)
|
||||
|
||||
$extensionUri = $MarketplaceUri + $ExtensionMarketPlaceName
|
||||
$request = Invoke-WebRequest -Uri $extensionUri -UseBasicParsing
|
||||
$request -match 'UniqueIdentifierValue":"(?<extensionname>[^"]*)' | Out-Null
|
||||
$extensionName = $Matches.extensionname
|
||||
$request -match 'VsixId":"(?<vsixid>[^"]*)' | Out-Null
|
||||
$vsixId = $Matches.vsixid
|
||||
$request -match 'AssetUri":"(?<uri>[^"]*)' | Out-Null
|
||||
$assetUri = $Matches.uri
|
||||
$request -match 'Microsoft\.VisualStudio\.Services\.Payload\.FileName":"(?<filename>[^"]*)' | Out-Null
|
||||
$fileName = $Matches.filename
|
||||
$downloadUri = $assetUri + "/" + $fileName
|
||||
|
||||
return [PSCustomObject] @{
|
||||
"ExtensionName" = $extensionName
|
||||
"VsixId" = $vsixId
|
||||
"FileName" = $fileName
|
||||
"DownloadUri" = $downloadUri
|
||||
}
|
||||
}
|
||||
|
||||
function Install-VsixExtension
|
||||
{
|
||||
Param
|
||||
|
||||
Reference in New Issue
Block a user