Skip to content

Build script fails when you have private PSRepositories #1326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thomasrayner opened this issue Aug 30, 2019 · 0 comments · Fixed by #1327
Closed

Build script fails when you have private PSRepositories #1326

thomasrayner opened this issue Aug 30, 2019 · 0 comments · Fixed by #1327

Comments

@thomasrayner
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant