nightroman / Mdbc

MongoDB Cmdlets for PowerShell
Apache License 2.0
141 stars 16 forks source link

Unable to download latest Mdbc version 6.5.5 in powershell #39

Closed pawan-regoti closed 4 years ago

pawan-regoti commented 4 years ago

While trying to download Mdbc I am getting package not valid error. Thus, unable to update Mdbc to latest version.

image

nightroman commented 4 years ago

What command do you use? Install-Package? I think you should use Install-Module instead.

pawan-regoti commented 4 years ago

I was using Install-Module command

nightroman commented 4 years ago

Install-Module works for me. It looks like something is wrong with your environment, PS packaging tools, etc. I do not know how to help. The latest module is downloaded 212 times and you are the first to report such an issue. I do not think the problem is with the module.

nightroman commented 4 years ago

As a workaround, install it manually. Go to https://www.powershellgallery.com/packages/Mdbc/6.5.5 , click Manual Download tab, and get the raw nupkg file. Save it as .zip, unzip, name the directory Mdbc. Copy this directory to one of you module directories, see $env:PSModulePath.

pawan-regoti commented 4 years ago

I was able to install Mdbc version 6.4.3 I am using inbuilt powershell (system32), so probably v1.0 PowershellGet version 1.0.0.1

nightroman commented 4 years ago

Show your $PSVersionTable. PowerShellGet is quite old, mine is 2.2.1

nightroman commented 4 years ago

I was able to install Mdbc version 6.4.3

There is no such version of Mdbc.

pawan-regoti commented 4 years ago

Sorry, I made a typo, I was able to install Mdbc version 6.5.4

nightroman commented 4 years ago

Sorry, I made a typo, I was able to install Mdbc version 6.5.4

So you can install 6.5.4 and cannot the next 6.5.5? Silly question, can you try again? Anyway, if it fails then I do not know what is wrong and how to help. Sorry.

nightroman commented 4 years ago

I have just compared packages 6.5.4 and 6.5.5. They look alike, same files, similar contents.

pawan-regoti commented 4 years ago

Looks like [Net.ServicePointManager]::SecurityProtocol is the issue, it only accepts [Net.SecurityProtocolType]::Tls12

So, setting [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 allowed me to download the package.

Weird behavior, considering the package 6.5.4 and 6.5.5 doesn't have any major changes

nightroman commented 4 years ago

Yes, it's very weird. But it's a useful experience and workaround to know. Closing?

pawan-regoti commented 4 years ago

yes, thanks a lot for your help :)