Skip to content

Commit

Permalink
update to pwsh 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Embstj committed Mar 9, 2020
1 parent c83b850 commit c32e130
Show file tree
Hide file tree
Showing 33 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion Help_Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:: This will run through a guided setup to start SWARM.
:: When finished it will save your settings.

pwsh-preview -executionpolicy Bypass -command ".\startup.ps1 -help"
pwsh -executionpolicy Bypass -command ".\startup.ps1 -help"

:: Once you have first ran SWARM, you can run this guided help again
:: through command prompt with the commmand ``swarm_help``
Expand Down
2 changes: 1 addition & 1 deletion Hive_Windows_Reset.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
:: Run this script to reset all saved settings. This will ::ove newarguments.json (current user parameters)
:: as well.

pwsh-preview -noexit -executionpolicy bypass -windowstyle maximized -command ".\build\powershell\scripts\reset.ps1"
pwsh -noexit -executionpolicy bypass -windowstyle maximized -command ".\build\powershell\scripts\reset.ps1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SWARM is very customizable. At the base layer- It is easy to setup by simply inp

SWARM was designed to make SWARM bigger than itself. All commands can be executed via bash scripts/shell commands on the linux side, and we are slowly implementing the same features to the window's side. With the ``Lite`` mode, SWARM can be easily incorporated into any current miningOS available, and users can customize/create their own launch process, independent of SWARM. In Windows, you should be able to run cmd.exe and powershell actions through HiveOS dashboard. An example of this would be:

``get-process | Where-Object name -eq "pwsh-preview"``
``get-process | Where-Object name -eq "pwsh"``

Would give you a list of all powershell core processes.

Expand Down
2 changes: 1 addition & 1 deletion Windows_10_Optimize.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ cd %~dp0

REM DON'T RUN WITH SWARM RUNNING!

pwsh-preview -executionpolicy Bypass -command ".\build\powershell\scripts\win_optimize.ps1"
pwsh -executionpolicy Bypass -command ".\build\powershell\scripts\win_optimize.ps1"

REM REBOOT advised afterwards.
2 changes: 1 addition & 1 deletion build/bash/version
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ c="!$3"
d="!$4"

source /etc/profile.d/SWARM.sh
pwsh-preview -command "$SWARM_DIR/build/powershell/scripts/version.ps1 -command $a -name $b -version $c -uri \"$d\""
pwsh -command "$SWARM_DIR/build/powershell/scripts/version.ps1 -command $a -name $b -version $c -uri \"$d\""
2 changes: 1 addition & 1 deletion build/bash/xconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ while true; do
echo -e $xNO$xRED$xBOLD"Please set Your email address in config file and reboot rig to start mining."$xNO
read
elif [ $MINER_PATH != "null" ]; then
sudo pwsh-preview -command "$MINER_PATH $MINER_OPTIONS_GO"
sudo pwsh -command "$MINER_PATH $MINER_OPTIONS_GO"
sleep=$((10+i))
[ $sleep -gt 60 ] && sleep=60
echo -e $xNO$xRED$xBOLD"Miner ended or crashed. Restarting miner in $sleep seconds..."$xNO
Expand Down
2 changes: 1 addition & 1 deletion build/cmd/active.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -executionpolicy bypass -command "& ""%SWARM_DIR%/build/powershell/scripts/active.ps1"""
pwsh -executionpolicy bypass -command "& ""%SWARM_DIR%/build/powershell/scripts/active.ps1"""
2 changes: 1 addition & 1 deletion build/cmd/bans.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bans.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bans.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/bench.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bench.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bench.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/clear_profits.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_profits.ps1 -Name %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_profits.ps1 -Name %*"
2 changes: 1 addition & 1 deletion build/cmd/clear_watts.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_watts.ps1 -Name %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_watts.ps1 -Name %*"
2 changes: 1 addition & 1 deletion build/cmd/features.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -executionpolicy bypass -command "Set-Location '%SWARM_DIR%'; invoke-expression "".\build\apps\features-win\features-win.exe"" | Tee-Object -Variable features | Out-Null; $features | Out-Host"
pwsh -executionpolicy bypass -command "Set-Location '%SWARM_DIR%'; invoke-expression "".\build\apps\features-win\features-win.exe"" | Tee-Object -Variable features | Out-Null; $features | Out-Host"
2 changes: 1 addition & 1 deletion build/cmd/get-lambo.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\data""; .\timedata.ps1"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\data""; .\timedata.ps1"
2 changes: 1 addition & 1 deletion build/cmd/get-oc.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getoc.ps1"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getoc.ps1"
2 changes: 1 addition & 1 deletion build/cmd/get.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set arg3=%3
set arg4=%4
set arg5=%5
set arg6=%6
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\get.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\get.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/lspci.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
cd %SWARM_DIR%

pwsh-preview -command ".\build\powershell\scripts\lspci.ps1 %*"
pwsh -command ".\build\powershell\scripts\lspci.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/miner.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set arg3=%3
set arg4=%4
set arg5=%5
set arg6=%6
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\miner.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\miner.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/modules.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\modules.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\modules.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/nvidia-smi.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -executionpolicy bypass -command "Set-Location '%SWARM_DIR%'; invoke-expression ""C:\PROGRA~1\NVIDIA~1\NVSMI\nvidia-smi.exe %*"" | Tee-Object -Variable NVSMI | Out-Null; $NVSMI | Out-Host"
pwsh -executionpolicy bypass -command "Set-Location '%SWARM_DIR%'; invoke-expression ""C:\PROGRA~1\NVIDIA~1\NVSMI\nvidia-smi.exe %*"" | Tee-Object -Variable NVSMI | Out-Null; $NVSMI | Out-Host"
2 changes: 1 addition & 1 deletion build/cmd/nview.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\view.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\view.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/stats.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getstats.ps1"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getstats.ps1"
2 changes: 1 addition & 1 deletion build/cmd/swarm_batch.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\swarm_batch.ps1 %*"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\swarm_batch.ps1 %*"
2 changes: 1 addition & 1 deletion build/cmd/swarm_help.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%""; .\build\powershell\scripts\help.ps1"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%""; .\build\powershell\scripts\help.ps1"
2 changes: 1 addition & 1 deletion build/cmd/version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set arg1=%1
set arg2=%2
set arg3=%3
set arg4=%4
pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\version.ps1 -command !%arg1% -name !%arg2% -version !%arg3% -uri !%arg4%"
pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\version.ps1 -command !%arg1% -name !%arg2% -version !%arg3% -uri !%arg4%"
4 changes: 2 additions & 2 deletions build/powershell/control/launchcode.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ function Global:Start-LaunchCode($MinerCurrent, $AIP) {
##Make Test.bat for users
$Algo = ($MinerCurrent.Algo).Replace("`/", "_")
$minerbat = @()
## pwsh-preview to launch powershell window to fully emulate SWARM launching
## pwsh to launch powershell window to fully emulate SWARM launching
$file = "$WorkingDirectory\swarm_start_$($Algo).ps1"
$exec = "$PSHOME\pwsh.exe"
$command = "`"Start-Process `"`"$exec`"`" -Verb Runas -ArgumentList `"`"-noexit -executionpolicy bypass -file `"`"`"`"$file`"`"`"`"`"`"`""
$minerbat += "pwsh-preview -ExecutionPolicy Bypass -command $Command"
$minerbat += "pwsh -ExecutionPolicy Bypass -command $Command"
$miner_bat = Join-Path $WorkingDirectory "swarm_start_$($Algo).bat"
$minerbat | Set-Content $miner_bat

Expand Down
2 changes: 1 addition & 1 deletion build/powershell/scripts/get.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ https://github.com/MaynardMiner/SWARM/wiki/HiveOS-management
$Get += "Appending old bat file."
$Bat_file[1] = "cd `/D `%`~dp0"
}
$Bat_file.replace("pwsh -executionpolicy Bypass","pwsh-preview -executionpolicy Bypass")
$Bat_file.replace("pwsh-preview -executionpolicy Bypass","pwsh -executionpolicy Bypass")
}
$Bat_file | Set-Content "$Dir\SWARM.bat"

Expand Down
2 changes: 1 addition & 1 deletion build/powershell/scripts/swarmon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if($Action) {
switch($Action) {
"on" {
if( -not ($Changed | Select-String "swarm_mode.txt") ) {
$Changed = $Changed -replace " /root/utils/update_configGet.sh"," /root/utils/update_configGet.sh`n if grep -Fxq `"Yes`" /root/swarm_mode.txt`n then`n pwsh-preview -command `"/root/SWARM/build/powershell/scripts/smos_config.ps1`"`n fi"; $Save = $True }
$Changed = $Changed -replace " /root/utils/update_configGet.sh"," /root/utils/update_configGet.sh`n if grep -Fxq `"Yes`" /root/swarm_mode.txt`n then`n pwsh -command `"/root/SWARM/build/powershell/scripts/smos_config.ps1`"`n fi"; $Save = $True }
"Yes" | Set-Content "/root/swarm_mode.txt"
if(-not (Test-Path "/root/xminer_old.sh")){Move-Item "/root/xminer.sh" "/root/xminer_old.sh" -Force}
Copy-Item -Path "/root/SWARM/build/bash/xconfig.sh" -Destination "/root/xminer.sh" -Force
Expand Down
26 changes: 13 additions & 13 deletions h-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ fi
## SWARM does its own logging
logs-off

## If pwsh-preview is not installed.
## If pwsh is not installed.
if ! [ -x "$(command -v pwsh)" ]; then
disk-expand
rm -rf /opt/microsoft/powershell/
rm -rf /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/7.0.0-rc.3
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7.0.0-rc.3
chmod +x /opt/microsoft/powershell/7.0.0-rc.3/pwsh
ln -s /opt/microsoft/powershell/7.0.0-rc.3/pwsh /usr/bin/pwsh
wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-x64.tar.gz -O /tmp/powershell.tar.gz --no-check-certificate
mkdir -p /opt/microsoft/powershell/7.0.0
tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7.0.0
chmod +x /opt/microsoft/powershell/7.0.0/pwsh
ln -s /opt/microsoft/powershell/7.0.0/pwsh /usr/bin/pwsh
rm -rf /tmp/powershell.tar.gz
fi

PVERSION=`pwsh -version`

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

Expand Down
6 changes: 3 additions & 3 deletions help/Change.log
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Changelog
-Windows: Miner Delay works on HiveOS.
* SWARM starts, but goes to sleep.

-HiveOS: Auto-Upgrade of pwsh-preview to 6.2.0
-HiveOS: Auto-Upgrade of pwsh to 6.2.0

-SWARM will now save version of miner to
swarm-version.txt in bin folder of miner.
Expand Down Expand Up @@ -1145,7 +1145,7 @@ OR NEWER- UPDATE IMMEDIATELY.
* Added custom launchcode.dll in apps folder.
* Removed extra console launch in Windows version.
* cmd.exe isn't used anymore in SWARM.
* everything works directly from pwsh-preview.exe
* everything works directly from pwsh.exe
* Add more console info.
* notifies user test batch files are made
to test miners, and location
Expand Down Expand Up @@ -2064,7 +2064,7 @@ but beta in design.
## NOTE
* Powershell version 7.0 or higher is required in this
release for those not using HiveOS. The exec name of
powershell should be 'pwsh-preview'. ``install_linux``
powershell should be 'pwsh'. ``install_linux``
should install it.

Due to the amount of changes in release- A wiki article
Expand Down
14 changes: 7 additions & 7 deletions help_linux
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This will start swarm with -help command.
# This will run through a guided setup to start SWARM.
# When finished it will save your settings.
# It will install pwsh-preview if not installed.
# It will install pwsh if not installed.

# Once you have first ran SWARM, you can run this guided help again
# through terminal with the commmand ``swarm_help``
Expand All @@ -15,18 +15,18 @@
# HiveOS flight sheet.

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

## Start the help script.
pwsh-preview -command ".\build\powershell\scripts\help.ps1"
pwsh -command ".\build\powershell\scripts\help.ps1"
34 changes: 17 additions & 17 deletions install_linux
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This will install correct version of powershell. No dependencies should be
# be required.
#
# This should be ran as root, so that it can make pwsh-preview an exectuable.
# This should be ran as root, so that it can make pwsh an exectuable.
#
# This will also run install.ps1, which will install commands in /usr/bin
# so that they can be open from any terminal. To see list of commands
Expand All @@ -17,32 +17,32 @@
# *******************************************************************************

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

PVERSION=`pwsh-preview -version`
PVERSION=`pwsh -version`

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

## Run install script per command request.
echo 'starting install script'
pwsh-preview -command ".\build\powershell\scripts\install.ps1"
pwsh -command ".\build\powershell\scripts\install.ps1"
6 changes: 3 additions & 3 deletions startup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Set-Location $Dir
## Check to make sure that Windows was start with correct pwsh
if ($IsWindows) {
$Bat_File = Get-Content ".\SWARM.bat"
$Preview = $Bat_File | Select-String "pwsh -executionpolicy Bypass"
$Preview = $Bat_File | Select-String "pwsh-preview -executionpolicy Bypass"
if($Preview) {
$Bat_File = $Bat_File.Replace("pwsh -executionpolicy Bypass","pwsh-preview -executionpolicy Bypass")
$Bat_File = $Bat_File.Replace("pwsh-preview -executionpolicy Bypass","pwsh -executionpolicy Bypass")
$Bat_File | Set-Content ".\SWARM.bat"
Write-Host "Edited Bat File to use pwsh-preview then restarted."
Write-Host "Edited Bat File to use pwsh then restarted."
Write-Host "This will only happen once."
Start-Sleep -S 5
Start-Process "SWARM.bat"
Expand Down
Loading

0 comments on commit c32e130

Please sign in to comment.