Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

Unable to register package source #11

Closed
ethanbergstrom opened this issue Jun 26, 2020 · 10 comments
Closed

Unable to register package source #11

ethanbergstrom opened this issue Jun 26, 2020 · 10 comments
Labels
invalid This doesn't seem right

Comments

@ethanbergstrom
Copy link
Owner

Hello @ethanbergstrom,

I saw that there was a new version 1.2.0 of Chocolatier. I don't know if anyone has tested adding their own repository via "register-packagesource" commands, but I get an error in the 'name' parameter (see below)

PS C:\Windows\system32> Register-PackageSource -name TEST -location https://myrepo/nuget -provider Chocolatier -Trusted

WARNING: MSG:UnableToDownload «https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
WARNING: Unable to download the list of available providers. Check your internet connection.
Register-PackageSource : Cannot bind argument to parameter 'name' because it is an empty string.
At line:1 char:1

  • Register-PackageSource -name TEST -location https://myrepo ...
  •   + CategoryInfo          : InvalidData: (Microsoft.Power...erPackageSource:RegisterPackageSource) [Register-PackageSource], Exception
      + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,New-PackageSource,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSour 
     ce
    
    

Can you confirm. Do you have that the same problem?
Is this a mistake on the side of the new provider Chocolatier 1.2.0 ?

This problem does not occur in a e.g. 1.0.4 Chocolatier version.

Originally posted by @Gregoorio in jianyunt/ChocolateyGet#15 (comment)

@ethanbergstrom
Copy link
Owner Author

Hey @Gregoorio,

I'm not able to reproduce the issue you're seeing. What version of PowerShell are you using?

@Gregoorio
Copy link

@ethanbergstrom,

I'm using the 5.1 powershell version. In version 1.0.4 Chocolatier I used the same version and registration of the repository via (register-packagesource) command it is works.

@ethanbergstrom
Copy link
Owner Author

Could you paste the entire terminal output, including the registration command, in this thread?

@Gregoorio
Copy link

Hi @ethanbergstrom,

I've used command:
Register-PackageSource -name TEST -location https://myrepo.hs/nuget -provider Chocolatier -Trusted

And this is error:

WARNING: MSG:UnableToDownload «https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409» «»
WARNING: Unable to download the list of available providers. Check your internet connection.
Register-PackageSource : Cannot bind argument to parameter 'name' because it is an empty string.
At line:1 char:1

  • Register-PackageSource -name TEST -location https://myrepo.hs. ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidData: (Microsoft.Power...erPackageSource:RegisterPackageSource) [Register-PackageSource], Exception + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,New-PackageSource,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSource

I saw problem in the parameter 'name' but I don't know what is the matter

"Cannot bind argument to parameter 'name' because it is an empty string."

@ethanbergstrom
Copy link
Owner Author

I just tried it in a clean Windows Sandbox environment, and I'm not seeing that issue:
image

@ethanbergstrom
Copy link
Owner Author

Could you confirm how you're installing the package provider? From the output, it looks like your machine isn't connected to the internet. Are you mirroring the package provider module to an internal NuGet repository?

@Gregoorio
Copy link

Gregoorio commented Jun 27, 2020

Yes, you are right. My machine has no internet.
I have download a Chocolatier package from another machine that has the Internet and copy folders to a machine without the Internet.
I have an external nugget repository by (nuget server).
From a machine that doesn't have internet I register my nuget repository. In version 1.0.4 of Provider Chocolatier it works. However in version 1.2.0 I have a problem with the 'name' parameter.

@ethanbergstrom
Copy link
Owner Author

ethanbergstrom commented Jun 27, 2020

I'm not sure what your issue may be then, other than some sort of issue in your copy process to the disconnected machine.

I just tried copying the module into a Windows Sandbox instance without any internet connection, and it worked after I set the execution policy to RemoteSigned.

image

@Gregoorio
Copy link

Hi ethanbergstrom,

I copied the files from chocolatier provider 1.0.4 into the machine without the internet connection. There's one thing that has been bothering me, so I have deregistered my repository and copied the provider 1.2.0 files. Once again I have tried to register and the registered correctly.
I don't know what was the reason for the problem before. Currently the registered repository works in provider version 1.2.0.
Sorry for the confusion and thank you for your analysis.

@ethanbergstrom
Copy link
Owner Author

ethanbergstrom commented Jun 28, 2020

Great! Glad you were able to get it working.

@ethanbergstrom ethanbergstrom added the invalid This doesn't seem right label Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants