Authorize feeds in all nuget.config files throughout the repo

This commit is contained in:
Andrew Arnott 2020-04-20 12:19:03 -06:00
Родитель 35cd5a2502
Коммит 498b5e6a34
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A9B9910CDCCDA441
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -46,14 +46,20 @@ if ($IsMacOS -or $IsLinux) {
if ($AccessToken) {
$endpoints = @()
$nugetConfig = [xml](Get-Content -Path "$PSScriptRoot\..\nuget.config")
$endpointURIs = @()
Get-ChildItem "$PSScriptRoot\..\nuget.config" -Recurse |% {
$nugetConfig = [xml](Get-Content -Path $_)
$nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
$endpoint = New-Object -TypeName PSObject
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken
$endpoints += $endpoint
$nugetConfig.configuration.packageSources.add |? { ($_.value -match '^https://pkgs\.dev\.azure\.com/') -or ($_.value -match '^https://[\w\-]+\.pkgs\.visualstudio\.com/') } |% {
if ($endpointURIs -notcontains $_.Value) {
$endpointURIs += $_.Value
$endpoint = New-Object -TypeName PSObject
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name endpoint -Value $_.value
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name username -Value ado
Add-Member -InputObject $endpoint -MemberType NoteProperty -Name password -Value $AccessToken
$endpoints += $endpoint
}
}
}
$auth = New-Object -TypeName PSObject