Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,6 @@ u
- demos/DSC/readme.md
#endregion

#region demos/install/README.md Overrides
- demos/install/README.md
download.sh
#endregion

#region demos/python/README.md Overrides
- demos/python/README.md
_script.ps1
Expand Down
6 changes: 3 additions & 3 deletions demos/install/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Install demo
# Install demo

For Windows refer to the [installation instructions](https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md)
For Windows refer to the [installation instructions](https://github.com/PowerShell/PowerShell/blob/master/docs/installation/windows.md).

For Linux, using [download.sh](https://github.com/PowerShell/PowerShell/blob/master/tools/download.sh) is the best way to deploy PowerShell bits
For Linux, using [`install-powershell.sh`](https://github.com/PowerShell/PowerShell/blob/master/tools/install-powershell-readme.md) is the best way to deploy PowerShell bits.
2 changes: 1 addition & 1 deletion docs/building/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Installing the toolchain is as easy as running `Start-PSBootstrap` in PowerShell
Of course, this requires a self-hosted copy of PowerShell on Linux.

Fortunately, this is as easy as [downloading and installing the package](../installation/linux.md).
The `./tools/download.sh` script will also install the PowerShell package.
The `./tools/install-powershell.sh` script will also install the PowerShell package.

In Bash:

Expand Down
151 changes: 0 additions & 151 deletions tools/download.sh

This file was deleted.

4 changes: 3 additions & 1 deletion tools/installpsh-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ $SUDO apt-get update
# Install PowerShell
$SUDO apt-get install -y powershell

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"'
pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'

success=$?

if [[ "$success" != 0 ]]; then
Expand Down
4 changes: 3 additions & 1 deletion tools/installpsh-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ if [[ "'$*'" =~ includeide ]] ; then
code --install-extension ms-vscode.PowerShell
fi

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"'
pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'

success=$?

if [[ "$success" != 0 ]]; then
Expand Down
4 changes: 3 additions & 1 deletion tools/installpsh-redhat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ echo "*** Setting up PowerShell Core repo..."
$SUDO curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
$SUDO yum install -y powershell

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"'
pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'

success=$?

if [[ "$success" != 0 ]]; then
Expand Down
46 changes: 36 additions & 10 deletions tools/installpsh-suse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ VERSION="1.1.2"
gitreposubpath="PowerShell/PowerShell/master"
gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=suse
repobased=true
repobased=false
gitscriptname="installpsh-suse.psh"

echo
Expand Down Expand Up @@ -116,15 +116,22 @@ fi

#END Verify The Installer Choice

echo
echo "*** Installing prerequisites for PowerShell Core..."
$SUDO zypper --non-interactive install \
glibc-locale \
glibc-i18ndata \
tar \
curl \
libunwind \
libicu \
openssl \
&& zypper --non-interactive clean --all

##END Check requirements and prerequisites

echo
echo "*** Installing PowerShell Core for $DistroBasedOn..."
if ! hash curl 2>/dev/null; then
echo "curl not found, installing..."
$SUDO zypper install -y curl
fi
release=`curl https://api.github.com/repos/powershell/powershell/releases/latest | sed '/tag_name/!d' | sed s/\"tag_name\"://g | sed s/\"//g | sed s/v//g | sed s/,//g | sed s/\ //g`

#REPO BASED (Not ready yet)
Expand All @@ -140,8 +147,8 @@ release=`curl https://api.github.com/repos/powershell/powershell/releases/latest
#$SUDO zypper --non-interactive install powershell

#DIRECT DOWNLOAD
packagerel=`echo $release | sed 's/-/_/'`
package=powershell-${packagerel}-1.suse.42.1.x86_64.rpm
pwshlink=/usr/bin/pwsh
package=powershell-${release}-linux-x64.tar.gz
downloadurl=https://github.com/PowerShell/PowerShell/releases/download/v$release/$package

echo "Destination file: $package"
Expand All @@ -154,10 +161,29 @@ if [[ ! -r "$package" ]]; then
exit 1
fi

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo zypper --non-interactive install "./$package"
## Create the target folder where powershell will be placed
$SUDO mkdir -p /opt/microsoft/powershell/$release
## Expand powershell to the target folder
$SUDO tar zxf $package -C /opt/microsoft/powershell/$release

## Change the mode of 'pwsh' to 'rwxr-xr-x' to allow execution
$SUDO chmod 755 /opt/microsoft/powershell/$release/pwsh
## Create the symbolic link that points to powershell
$SUDO ln -s /opt/microsoft/powershell/$release/pwsh $pwshlink

## Add the symbolic link path to /etc/shells
if [ ! -f /etc/shells ] ; then
echo $pwshlink | $SUDO tee /etc/shells ;
else
grep -q "^${pwshlink}$" /etc/shells || echo $pwshlink | $SUDO tee --append /etc/shells > /dev/null ;
fi

## Remove the downloaded package file
rm -f $package

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'

powershell -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME"'
success=$?

if [[ "$success" != 0 ]]; then
Expand Down