[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:
Mikhail Timofeev
2021-04-23 19:38:43 +03:00
committed by GitHub
parent 5690645f0e
commit cd4ecad2e6
6 changed files with 63 additions and 40 deletions

View File

@@ -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