psake / PowerShellBuild

Common build tasks for psake and Invoke-Build that build and test PowerShell modules
MIT License
134 stars 24 forks source link

Publish task uses API key OR Credential but does not support both #29

Closed pauby closed 5 years ago

pauby commented 5 years ago

The Publish task requires the API Key or Credential to be set but not both.

Expected Behavior

If I have provided credentials to the build and an API key I expect them to be both used.

Current Behavior

If an API Key is provided then the credentials are not used. Because the PowerShellGet cmdlets appear to be broken with regards to authentication (https://github.com/PowerShell/PowerShellGet/issues/433) you need to supply credentials with each cmdlet.

Allowing the use of both the API Key and Credentials would circumvent this.

Possible Solution

In the Publish task amend the code to use both API Key and Credential if supplied. If the PowerShellGet issues are resolved this will still not hurt.

Context

I can't publish the module to a private authenticated feed.

Your Environment