Skip to content
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

iex cannot convert Tls12 to type System.Int32 #2083

Closed
femrich opened this issue Mar 4, 2018 · 6 comments · Fixed by #2084
Closed

iex cannot convert Tls12 to type System.Int32 #2083

femrich opened this issue Mar 4, 2018 · 6 comments · Fixed by #2084

Comments

@femrich
Copy link

femrich commented Mar 4, 2018

I am running windows 7, sp 1, checked for updates and loaded PS yesterday. From the PS command line I am running the command:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

But I receive the following error:

Invoke-Expression : Cannot convert value "Tls12" to type "System.Int32". Error: "Input string was not in a correct format." AT line:24 char: 1
+Invoke-Expression (new-object net.webclient).downloadstring($core_url)

  • CategoryInfo : InvalidArgument: (:) [Invoke-Expression], RuntimeException
  • FullyQualifiedErrorId : InvalidCastFromStringToInteger,Microsoft.Powershell.Commands.InvokeExpressionCommand

Can you tell me please what this means and how to resolve it?

I am a non-tech person self-educated over years setting up and maintaining personal drupal sites, and doing this now to keep up with the requirements for drupal8. I have little to no experience with command line, but doing this to work with the now-required Composer. Any help you can offer with explaining and resolving this error and pointing me to resources to help me on my quest would be much appreciated.

Thanks.

@milang
Copy link
Contributor

milang commented Mar 4, 2018

Same issue in Windows 8.1:

image

@chawyehsu
Copy link
Member

chawyehsu commented Mar 4, 2018

Hey, please try this, and tell me if it works:

  1. find scoop\lib\core.ps1
cd ~/scoop/apps/scoop/current/lib/
  1. edit core.ps1, line 23 to 26:

from:

function enable-encryptionscheme($scheme) {
  [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $scheme
}
enable-encryptionscheme "Tls12"

to:

function enable-encryptionscheme() {
  [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
}
enable-encryptionscheme

Besides, what's the version of .NET framework your system installed? You should have .NET 4.5 and above installed to use TLSv1.2.

@milang
Copy link
Contributor

milang commented Mar 4, 2018

@h404bi yes your solution works, I had the same idea and created PR #2084 for the issue.

@femrich
Copy link
Author

femrich commented Mar 4, 2018

I tried this command in Powershell:

cd ~/scoop/apps/scoop/current/lib/

Got an error saying the file does not exist.

Searched my system for Scoop and all it came up with was a file in LibreOffice. I think my first error was indicating Scoop had not been downloaded, no?

@chawyehsu
Copy link
Member

@femrich yeah, you haven't install scoop successfully. Try this before this issue being fixed:

iex (new-object net.webclient).downloadstring('https://gist.githubusercontent.com/h404bi/e70ce87b0c523f33f2ff041a657a6182/raw/2e3c26d5e425531f23c292baf3e16f0b0e8dad68/install.ps1')

@femrich
Copy link
Author

femrich commented Mar 4, 2018

@h404bi as a result, Scoop was installed successfully! Thanks very much! I am looking forward to learning more about this tool and much appreciate the support from you and @milang !

Cheers!

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.

3 participants