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
2 changes: 1 addition & 1 deletion tools/install-powershell-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* -includeide - installs vscode and vscode powershell extension (only relevant to machines with desktop environment)
* -interactivetesting - do a quick launch test of vscode - only relevant when used with -includeide
* -skip-sudo-check - use sudo without verifying it's availability (hard to accurately do on some distros)
* -allowprerelease - includes prereleases of powershell core when selection allows this. Repository based installs take the latest on the repo url regardless of this switch.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically, this is a breaking change, but not in the product

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine since it hasn't been in for long

Copy link
Contributor Author

@DarwinJS DarwinJS Jun 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it was only working for 24-36 hours. But the "allow" made it sound like they wouldn't be isolated, parallel installs, but possibly install over production.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this lgtm, but I'm supposed to give 24 hours for review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also these changes are just trying to keep up with significant "breaking change" design decisions - like establishing the entirely separate package id for previews. It's a great change - but such shifts are the lions share of "breaking" compared to the breaking code changes needed to support them.

* -preview - installs preview of powershell core side-by-side with any existing production releases.

## Usage

Expand Down
11 changes: 6 additions & 5 deletions tools/installpsh-amazonlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=amazonlinux
repobased=false
gitscriptname="installpsh-amazonlinux.psh"
pwshlink=/usr/bin/pwsh

echo
echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
Expand Down Expand Up @@ -157,19 +158,19 @@ $SUDO yum install -y \
echo
echo "*** Installing PowerShell Core for $DistroBasedOn..."

echo "ATTENTION: As of version 1.2.0 this script no longer uses pre-releases unless the '-allowprereleases' switch is used"
echo "ATTENTION: As of version 1.2.0 this script no longer uses pre-releases unless the '-preview' switch is used"

if [[ "'$*'" =~ allowprerelease ]] ; then
if [[ "'$*'" =~ preview ]] ; then
echo
echo "-allowprerelease was used, prereleases will be included in the retrieval of the latest version"
echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)"
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// | sed s/,//g | sed s/\ //g`
pwshlink=/usr/bin/pwsh-preview
else
echo "Finding the latest release production release"
echo "Finding the latest production release"
release=$(curl https://api.github.com/repos/PowerShell/PowerShell/releases | grep -Po '"tag_name":(\d*?,|.*?[^\\]",)' | grep -Po '\d+.\d+.\d+[\da-z.-]*' | grep -v '[a-z]' | sort | tail -n1)
if

#DIRECT DOWNLOAD
pwshlink=/usr/bin/pwsh
package=powershell-${release}-linux-x64.tar.gz
downloadurl=https://github.com/PowerShell/PowerShell/releases/download/v$release/$package

Expand Down
8 changes: 5 additions & 3 deletions tools/installpsh-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=debian
repobased=true
gitscriptname="installpsh-debian.psh"
powershellpackageid=powershell

echo ;
echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
Expand Down Expand Up @@ -122,9 +123,10 @@ if ! hash curl 2>/dev/null; then
$SUDO apt-get install -y curl
fi

if [[ "'$*'" =~ allowprerelease ]] ; then
if [[ "'$*'" =~ preview ]] ; then
echo
echo "-allowprerelease was used, but since $DistroBasedOn uses repositories - selection of releases will depend on the repository contents."
echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)"
powershellpackageid=powershell-preview
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// | sed s/,//g | sed s/\ //g`
Expand Down Expand Up @@ -170,7 +172,7 @@ esac
# Update apt-get
$SUDO apt-get update
# Install PowerShell
$SUDO apt-get install -y powershell
$SUDO apt-get install -y ${powershellpackageid}

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'
Expand Down
8 changes: 5 additions & 3 deletions tools/installpsh-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=osx
repobased=true
gitscriptname="installpsh-osx.sh"
powershellpackageid=powershell

echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
echo "*** Current PowerShell Core Version: $currentpshversion"
Expand Down Expand Up @@ -88,9 +89,10 @@ fi

echo "*** Installing PowerShell Core for $DistroBasedOn..."

if [[ "'$*'" =~ allowprerelease ]] ; then
if [[ "'$*'" =~ preview ]] ; then
echo
echo "-allowprerelease was used, but since $DistroBasedOn uses repositories - selection of releases will depend on the repository contents."
echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)"
powershellpackageid=powershell-preview
fi

if ! hash brew 2>/dev/null; then
Expand Down Expand Up @@ -136,7 +138,7 @@ fi

if ! hash pwsh 2>/dev/null; then
echo "Installing PowerShell..."
if ! brew cask install powershell; then
if ! brew cask install ${powershellpackageid}; then
echo "ERROR: PowerShell failed to install! Cannot install powershell..." >&2
fi
else
Expand Down
8 changes: 5 additions & 3 deletions tools/installpsh-redhat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=redhat
repobased=true
gitscriptname="installpsh-redhat.psh"
powershellpackageid=powershell

echo
echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
Expand Down Expand Up @@ -107,9 +108,10 @@ if (( $EUID != 0 )); then
fi
fi

if [[ "'$*'" =~ allowprerelease ]] ; then
if [[ "'$*'" =~ preview ]] ; then
echo
echo "-allowprerelease was used, but since $DistroBasedOn uses repositories - selection of releases will depend on the repository contents."
echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)"
powershellpackageid=powershell-preview
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// | sed s/,//g | sed s/\ //g`echo
Expand All @@ -124,7 +126,7 @@ echo "*** Current version on git is: $release, repo version may differ slightly.

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
$SUDO yum install -y ${powershellpackageid}

pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME.
Run `"pwsh`" to start a PowerShell session."'
Expand Down
21 changes: 12 additions & 9 deletions tools/installpsh-suse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools"
thisinstallerdistro=suse
repobased=false
gitscriptname="installpsh-suse.psh"
powershellpackageid=powershell
pwshlink=/usr/bin/pwsh

echo
echo "*** PowerShell Core Development Environment Installer $VERSION for $thisinstallerdistro"
Expand Down Expand Up @@ -139,16 +141,22 @@ $SUDO zypper --non-interactive install \
echo
echo "*** Installing PowerShell Core for $DistroBasedOn..."

echo "ATTENTION: As of version 1.2.0 this script no longer uses pre-releases unless the '-allowprereleases' switch is used"
echo "ATTENTION: As of version 1.2.0 this script no longer uses pre-releases unless the '-preview' switch is used"

if [[ "'$*'" =~ allowprerelease ]] ; then
if [[ "'$*'" =~ preview ]] ; then
echo
echo "-allowprerelease was used, prereleases will be included in the retrieval of the latest version"
echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)"
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// | sed s/,//g | sed s/\ //g`
pwshlink=/usr/bin/pwsh-preview
else
echo "Finding the latest release production release"
echo "Finding the latest production release"
release=$(curl https://api.github.com/repos/PowerShell/PowerShell/releases | grep -Po '"tag_name":(\d*?,|.*?[^\\]",)' | grep -Po '\d+.\d+.\d+[\da-z.-]*' | grep -v '[a-z]' | sort | tail -n1)
if
#DIRECT DOWNLOAD
package=powershell-${release}-linux-x64.tar.gz
downloadurl=https://github.com/PowerShell/PowerShell/releases/download/v$release/$package


#REPO BASED (Not ready yet)
#echo "*** Setting up PowerShell Core repo..."
#echo "*** Current version on git is: $release, repo version may differ slightly..."
Expand All @@ -161,11 +169,6 @@ if
## Install PowerShell
#$SUDO zypper --non-interactive install powershell

#DIRECT DOWNLOAD
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"
echo "Source URL: $downloadurl"

Expand Down