Skip to content

Commit

Permalink
set pwsh to 6.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MaynardMiner committed Feb 7, 2020
1 parent 9b48081 commit 4305c92
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
24 changes: 12 additions & 12 deletions h-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ logs-off
## If pwsh is not installed.
if ! [ -x "$(command -v pwsh)" ]; then
disk-expand
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.3-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.3
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.3
chmod +x /opt/microsoft/powershell/6.2.3/pwsh
ln -s /opt/microsoft/powershell/6.2.3/pwsh /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.4-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.4
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.4
chmod +x /opt/microsoft/powershell/6.2.4/pwsh
ln -s /opt/microsoft/powershell/6.2.4/pwsh /usr/bin/pwsh
rm -rf /tmp/powershell.tar.gz
fi

PVERSION=`pwsh -version`

## If pwsh is wrong version, install it again.
if [ "$PVERSION" != "PowerShell 6.2.3" ]; then
if [ "$PVERSION" != "PowerShell 6.2.4" ]; then
echo "updating powershell to latest version"
rm -rf /opt/microsoft/powershell/6.2.1
rm -rf /opt/microsoft/powershell/6.2.3
rm -rf /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.3-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.3
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.3
chmod +x /opt/microsoft/powershell/6.2.3/pwsh
ln -s /opt/microsoft/powershell/6.2.3/pwsh /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.4
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.4
chmod +x /opt/microsoft/powershell/6.2.4/pwsh
ln -s /opt/microsoft/powershell/6.2.4/pwsh /usr/bin/pwsh
rm -rf /tmp/powershell.tar.gz
fi

Expand Down
27 changes: 21 additions & 6 deletions install_linux
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,31 @@

## If powershell doesn't exist- Assume it is a first time run.
if ! [ -x "$(command -v pwsh)" ]; then
echo 'pwsh not found- installing 6.2.3'
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.3-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.3
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.3
chmod +x /opt/microsoft/powershell/6.2.3/pwsh
ln -s /opt/microsoft/powershell/6.2.3/pwsh /usr/bin/pwsh
echo 'pwsh not found- installing 6.2.4'
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.4-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.4
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.4
chmod +x /opt/microsoft/powershell/6.2.4/pwsh
ln -s /opt/microsoft/powershell/6.2.4/pwsh /usr/bin/pwsh
rm -rf /tmp/powershell.tar.gz
chmod 777 -R $HOME/.local/share/powershell
fi

PVERSION=`pwsh -version`

## If pwsh is wrong version, install it again.
if [ "$PVERSION" != "PowerShell 6.2.4" ]; then
echo "updating powershell to latest version"
rm -rf /opt/microsoft/powershell/6.2.3
rm -rf /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/6.2.4
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.2.4
chmod +x /opt/microsoft/powershell/6.2.4/pwsh
ln -s /opt/microsoft/powershell/6.2.4/pwsh /usr/bin/pwsh
rm -rf /tmp/powershell.tar.gz
fi

## Run install script per command request.
echo 'starting install script'
pwsh -command ".\build\powershell\scripts\install.ps1"
4 changes: 2 additions & 2 deletions swarm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ if ($IsWindows) {
}

## Check Powershell version. Output warning.
if ($PSVersionTable.PSVersion -ne "6.2.3") {
if ($PSVersionTable.PSVersion -ne "6.2.4") {
Write-Host "WARNING: Powershell Core Version is $($PSVersionTable.PSVersion)" -ForegroundColor Red
Write-Host "Currently supported version for SWARM is 6.2.3" -ForegroundColor Red
Write-Host "Currently supported version for SWARM is 6.2.4" -ForegroundColor Red
Write-Host "SWARM will continue anyways- It may cause issues." -ForegroundColor Red
## Create a pause in case window is scrolling too fast.
Start-Sleep -S 10
Expand Down

0 comments on commit 4305c92

Please sign in to comment.