From 2c30435600de43478ccc73fcedc886a15416f219 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 7 Dec 2021 15:35:28 -0800 Subject: [PATCH 1/2] Register nuget source --- tools/findMissingNotices.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/findMissingNotices.ps1 b/tools/findMissingNotices.ps1 index 275116da79b..315a83284d7 100644 --- a/tools/findMissingNotices.ps1 +++ b/tools/findMissingNotices.ps1 @@ -13,6 +13,11 @@ Import-Module dotnet.project.assets Import-Module "$PSScriptRoot\..\.github\workflows\GHWorkflowHelper" -Force . "$PSScriptRoot\..\tools\buildCommon\startNativeExecution.ps1" +$packageSourceName = 'findMissingNoticesNugetOrg' +if (!(Get-PackageSource -Name $packageSourceName -ErrorAction SilentlyContinue)) { + $null = Register-PackageSource -Name $packageSourceName -Location https://www.nuget.org/api/v2 -ProviderName NuGet +} + $existingRegistrationTable = @{} $cgManifestPath = (Resolve-Path -Path $PSScriptRoot\..\tools\cgmanifest.json).ProviderPath $existingRegistrationsJson = Get-Content $cgManifestPath | ConvertFrom-Json -AsHashtable @@ -109,7 +114,9 @@ function New-NugetComponent { $nugetPublicVersionCache = [System.Collections.Generic.Dictionary[string, string]]::new() function Get-NuGetPublicVersion { param( + [parameter(Mandatory)] [string]$Name, + [parameter(Mandatory)] [string]$Version ) @@ -124,7 +131,7 @@ function Get-NuGetPublicVersion { } $publicVersion = $null - $publicVersion = Find-Package -Name $Name -AllowPrereleaseVersions -source nuget.org -AllVersions -ErrorAction SilentlyContinue | ForEach-Object { + $publicVersion = Find-Package -Name $Name -AllowPrereleaseVersions -source $packageSourceName -AllVersions -ErrorAction SilentlyContinue | ForEach-Object { try { $packageVersion = [System.Management.Automation.SemanticVersion]$_.Version } catch { From d5fafea4b0ebd92df992bfb3862ceee964bcf659 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Sat, 18 Dec 2021 11:51:35 -0800 Subject: [PATCH 2/2] update cgmanifest --- tools/cgmanifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cgmanifest.json b/tools/cgmanifest.json index 96137367dd2..3816494e256 100644 --- a/tools/cgmanifest.json +++ b/tools/cgmanifest.json @@ -695,7 +695,7 @@ "Type": "nuget", "Nuget": { "Name": "StyleCop.Analyzers", - "Version": "1.2.0-beta.354" + "Version": "1.1.118" } }, "DevelopmentDependency": true