11#! /bin/bash
2- # Copyright (c) Microsoft Corporation. All rights reserved.
3- # Licensed under the MIT License.
42
53install (){
64 # Companion code for the blog https://cloudywindows.com
75
86 # call this code direction from the web with:
9- # bash <(wget -qO - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) <ARGUMENTS>
7+ # bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) <ARGUMENTS>
108 # wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh | bash -s <ARGUMENTS>
119 # bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) <ARGUMENTS>
1210
@@ -130,16 +128,9 @@ install(){
130128 else
131129 # Script files are not local - pull from remote
132130 echo " Could not find \" appimage.sh\" next to this script..."
133- echo " Pulling and executing it from \" $gitreposcriptroot /appimage.sh\" "
134- if [ -n " $( command -v curl) " ]; then
135- echo " found and using curl"
136- bash <( curl -s $gitreposcriptroot /appimage.sh) $@
137- elif [ -n " $( command -v wget) " ]; then
138- echo " found and using wget"
139- bash <( wget -qO- $gitreposcriptroot /appimage.sh) $@
140- else
141- echo " Could not find curl or wget, install one of these or manually download \" $gitreposcriptroot /appimage.sh\" "
142- fi
131+ echo " Pulling it from \" $gitreposcriptroot /appimage.sh\" "
132+ bash <( wget -qO- $gitreposcriptroot /appimage.sh) $@
133+ fi
143134 elif [ " $DistroBasedOn " == " redhat" ] || [ " $DistroBasedOn " == " debian" ] || [ " $DistroBasedOn " == " osx" ] || [ " $DistroBasedOn " == " suse" ] || [ " $DistroBasedOn " == " amazonlinux" ]; then
144135 echo " Configuring PowerShell Core Enviornment for: $DistroBasedOn $DIST $REV "
145136 if [ -f $SCRIPTFOLDER /installpsh-$DistroBasedOn .sh ]; then
@@ -148,16 +139,13 @@ install(){
148139 else
149140 # Script files are not local - pull from remote
150141 echo " Could not find \" installpsh-$DistroBasedOn .sh\" next to this script..."
151- echo " Pulling and executing it from \" $gitreposcriptroot /installpsh-$DistroBasedOn .sh\" "
152- if [ -n " $( command -v curl) " ]; then
153- echo " found and using curl"
142+ echo " Pulling it from \" $gitreposcriptroot /installpsh-$DistroBasedOn .sh\" "
143+ if [ " $OS " == " osx" ]; then
154144 bash <( curl -s $gitreposcriptroot /installpsh-$DistroBasedOn .sh) $@
155- elif [ -n " $( command -v wget) " ]; then
156- echo " found and using wget"
157- bash <( wget -qO- $gitreposcriptroot /installpsh-$DistroBasedOn .sh) $@
158145 else
159- echo " Could not find curl or wget, install one of these or manually download \" $gitreposcriptroot /installpsh-$DistroBasedOn .sh\" "
146+ bash <( wget -qO- $gitreposcriptroot /installpsh-$DistroBasedOn .sh) $@
160147 fi
148+ fi
161149 else
162150 echo " Sorry, your operating system is based on $DistroBasedOn and is not supported by PowerShell Core or this installer at this time."
163151 fi
0 commit comments