Skip to content

Build script fails when you have private PSRepositories #1326

Closed
@thomasrayner

Description

@thomasrayner

This issue occurs while building PSScriptAnalyzer when you have a private gallery added to your PSRepository list. There are several instances in the build scripts which install dependencies, presumably from the PowerShell Gallery, but don't specifically target that specific repository. Because of how Install-Module works, these private galleries are erroneously searched instead of retrieving the module from the PS Gallery.

Steps to reproduce

# Before continuing, add a private nuget feed to your PS Repositories using the Register-PSRepository command
.\build.ps1 -Clobber

Expected behavior

Build completes successfully.

Actual behavior

An error is presented if you are missing a necessary module.

VERBOSE: platyPS module not found or below required version of 0.12, installing the latest version.
[Warning] [CredentialProvider]Exception when fetching the authorization endpoint: The given header was not found.
[Warning] [CredentialProvider]   at System.Net.Http.Headers.HttpHeaders.GetValues(String name)
   at NuGetCredentialProvider.CredentialProviders.Vsts.AuthUtil.<GetAuthorizationEndpoint>d__6.MoveNext() in E:\A\_work\467\s\CredentialProvider.Microsoft\CredentialProviders\Vsts\IAuthUtil.cs:line 91
[Warning] [CredentialProvider]Could not find SPS authorization endpoint for https://redacted.pkgs.visualstudio.com/_packaging/redacted/nuget/v3
[Minimal] [CredentialProvider]DeviceFlow: https://redacted.pkgs.visualstudio.com/_packaging/redacted/nuget/v3
[Minimal] [CredentialProvider]ATTENTION: User interaction required.

    **********************************************************************

    To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code redacted to authenticate.

    **********************************************************************

[Warning] [CredentialProvider]Exception when fetching the authorization endpoint: The given header was not found.
[Warning] [CredentialProvider]   at System.Net.Http.Headers.HttpHeaders.GetValues(String name)
   at NuGetCredentialProvider.CredentialProviders.Vsts.AuthUtil.<GetAuthorizationEndpoint>d__6.MoveNext() in E:\A\_work\467\s\CredentialProvider.Microsoft\CredentialProviders\Vsts\IAuthUtil.cs:line 91
[Warning] [CredentialProvider]Could not find SPS authorization endpoint for https://redacted.pkgs.visualstudio.com/_packaging/redacted/nuget/v3

Environment data

This occurs while building PSScriptAnalyzer while you have private galleries added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions