Monki Majik
Monki Majik

Reputation: 51

Chocolatey doesn't install

Following the steps to install Chocolatey via Powershell doesn't work on my Windows 7 64bit PC. I'm following https://chocolatey.org/install#install-from-powershell-v3

Upvotes: 1

Views: 2336

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200573

PS C:\admin\scripts> iwr https://chocolatey.org/install.ps1 -UseBasicParsing


StatusCode        : 200
StatusDescription : OK
Content           : # =====================================================================
...

You're downloading a UTF-8-encoded file (the content begins with the characteristic UTF-8 byte order mark ), but it's being treated as ASCII text.

Besides:

I'm following https://chocolatey.org/install#install-from-powershell-v3.

No, you're not. The website you referenced tells you to use

iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

which works as advertised, whereas you're trying to use

iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex

If you want to use that approach you need to remove the BOM from the content before piping it into Invoke-Expression:

(iwr https://chocolatey.org/install.ps1 -UseBasicParsing).Content -replace '^' | iex

Upvotes: 1

Related Questions