Skip to content

Commit ca73bb3

Browse files
committed
windows 8 and 2012 need to skip wrapper
1 parent 4a979fc commit ca73bb3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/installs/chocolatey.ps1

+10-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,16 @@ function Invoke-CLR4PowerShellCommand {
4343
$ErrorActionPreference = 'Stop'
4444
Set-StrictMode -Version Latest
4545

46-
Invoke-CLR4PowerShellCommand -ScriptBlock {
47-
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
46+
$isWin8 = wmic os get caption | find /i '" 8 "'
47+
$isWin2012 = wmic os get caption | find /i '" 2012 "'
48+
49+
# skip wrapping for 8 or 2012?
50+
if ($isWin8 -or $isWin2012){
51+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
52+
}else{
53+
Invoke-CLR4PowerShellCommand -ScriptBlock {
54+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
55+
}
4856
}
4957

5058
# cribbed from https://gist.github.com/jstangroome/882528

0 commit comments

Comments
 (0)