From c32e13061a08671fadda8f9c51b8a9f70dfb3fd5 Mon Sep 17 00:00:00 2001 From: MaynardMiner Date: Mon, 9 Mar 2020 09:04:06 -0400 Subject: [PATCH] update to pwsh 7.0.0 --- Help_Windows.bat | 2 +- Hive_Windows_Reset.bat | 2 +- README.md | 2 +- Windows_10_Optimize.bat | 2 +- build/bash/version | 2 +- build/bash/xconfig.sh | 2 +- build/cmd/active.bat | 2 +- build/cmd/bans.bat | 2 +- build/cmd/bench.bat | 2 +- build/cmd/clear_profits.bat | 2 +- build/cmd/clear_watts.bat | 2 +- build/cmd/features.bat | 2 +- build/cmd/get-lambo.bat | 2 +- build/cmd/get-oc.bat | 2 +- build/cmd/get.bat | 2 +- build/cmd/lspci.bat | 2 +- build/cmd/miner.bat | 2 +- build/cmd/modules.bat | 2 +- build/cmd/nvidia-smi.bat | 2 +- build/cmd/nview.bat | 2 +- build/cmd/stats.bat | 2 +- build/cmd/swarm_batch.bat | 2 +- build/cmd/swarm_help.bat | 2 +- build/cmd/version.bat | 2 +- build/powershell/control/launchcode.psm1 | 4 +-- build/powershell/scripts/get.ps1 | 2 +- build/powershell/scripts/swarmon.ps1 | 2 +- h-run.sh | 26 +++++++++--------- help/Change.log | 6 ++--- help_linux | 14 +++++----- install_linux | 34 ++++++++++++------------ startup.ps1 | 6 ++--- swarm.ps1 | 6 ++--- 33 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Help_Windows.bat b/Help_Windows.bat index 3d7432074..04e078ad7 100755 --- a/Help_Windows.bat +++ b/Help_Windows.bat @@ -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`` diff --git a/Hive_Windows_Reset.bat b/Hive_Windows_Reset.bat index 5a02317b3..30596a208 100755 --- a/Hive_Windows_Reset.bat +++ b/Hive_Windows_Reset.bat @@ -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" \ No newline at end of file +pwsh -noexit -executionpolicy bypass -windowstyle maximized -command ".\build\powershell\scripts\reset.ps1" \ No newline at end of file diff --git a/README.md b/README.md index cce259b05..5947080ce 100755 --- a/README.md +++ b/README.md @@ -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. diff --git a/Windows_10_Optimize.bat b/Windows_10_Optimize.bat index 929626341..b0c48f8da 100644 --- a/Windows_10_Optimize.bat +++ b/Windows_10_Optimize.bat @@ -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. \ No newline at end of file diff --git a/build/bash/version b/build/bash/version index d6feee1c6..174859b9c 100755 --- a/build/bash/version +++ b/build/bash/version @@ -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\"" \ No newline at end of file +pwsh -command "$SWARM_DIR/build/powershell/scripts/version.ps1 -command $a -name $b -version $c -uri \"$d\"" \ No newline at end of file diff --git a/build/bash/xconfig.sh b/build/bash/xconfig.sh index 9ff146ca3..373a3b0c6 100755 --- a/build/bash/xconfig.sh +++ b/build/bash/xconfig.sh @@ -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 diff --git a/build/cmd/active.bat b/build/cmd/active.bat index b7f5c1d6f..fb958afce 100755 --- a/build/cmd/active.bat +++ b/build/cmd/active.bat @@ -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""" diff --git a/build/cmd/bans.bat b/build/cmd/bans.bat index ceb2b3c52..06342418e 100755 --- a/build/cmd/bans.bat +++ b/build/cmd/bans.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bans.ps1 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bans.ps1 %*" \ No newline at end of file diff --git a/build/cmd/bench.bat b/build/cmd/bench.bat index 18280d6ec..591545c18 100644 --- a/build/cmd/bench.bat +++ b/build/cmd/bench.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bench.ps1 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\bench.ps1 %*" \ No newline at end of file diff --git a/build/cmd/clear_profits.bat b/build/cmd/clear_profits.bat index fe1cd73cb..e2fa335f7 100755 --- a/build/cmd/clear_profits.bat +++ b/build/cmd/clear_profits.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_profits.ps1 -Name %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_profits.ps1 -Name %*" \ No newline at end of file diff --git a/build/cmd/clear_watts.bat b/build/cmd/clear_watts.bat index e9e88afd2..738711583 100755 --- a/build/cmd/clear_watts.bat +++ b/build/cmd/clear_watts.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_watts.ps1 -Name %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\clear_watts.ps1 -Name %*" \ No newline at end of file diff --git a/build/cmd/features.bat b/build/cmd/features.bat index 2d62b3197..46c9ccf64 100755 --- a/build/cmd/features.bat +++ b/build/cmd/features.bat @@ -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" \ No newline at end of file +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" \ No newline at end of file diff --git a/build/cmd/get-lambo.bat b/build/cmd/get-lambo.bat index 1700553a6..307cb490d 100755 --- a/build/cmd/get-lambo.bat +++ b/build/cmd/get-lambo.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\data""; .\timedata.ps1" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\data""; .\timedata.ps1" \ No newline at end of file diff --git a/build/cmd/get-oc.bat b/build/cmd/get-oc.bat index 287e9694c..62c96984a 100755 --- a/build/cmd/get-oc.bat +++ b/build/cmd/get-oc.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getoc.ps1" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\getoc.ps1" \ No newline at end of file diff --git a/build/cmd/get.bat b/build/cmd/get.bat index adf4bb456..b0feb1fdc 100755 --- a/build/cmd/get.bat +++ b/build/cmd/get.bat @@ -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 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\get.ps1 %*" \ No newline at end of file diff --git a/build/cmd/lspci.bat b/build/cmd/lspci.bat index eb9bfb15f..627c8e604 100644 --- a/build/cmd/lspci.bat +++ b/build/cmd/lspci.bat @@ -1,4 +1,4 @@ @echo off cd %SWARM_DIR% -pwsh-preview -command ".\build\powershell\scripts\lspci.ps1 %*" \ No newline at end of file +pwsh -command ".\build\powershell\scripts\lspci.ps1 %*" \ No newline at end of file diff --git a/build/cmd/miner.bat b/build/cmd/miner.bat index 943255181..5c47fb468 100644 --- a/build/cmd/miner.bat +++ b/build/cmd/miner.bat @@ -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 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\miner.ps1 %*" \ No newline at end of file diff --git a/build/cmd/modules.bat b/build/cmd/modules.bat index a1c746af5..6649673de 100755 --- a/build/cmd/modules.bat +++ b/build/cmd/modules.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\modules.ps1 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\modules.ps1 %*" \ No newline at end of file diff --git a/build/cmd/nvidia-smi.bat b/build/cmd/nvidia-smi.bat index b33d8c479..25c00a9c0 100755 --- a/build/cmd/nvidia-smi.bat +++ b/build/cmd/nvidia-smi.bat @@ -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" \ No newline at end of file +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" \ No newline at end of file diff --git a/build/cmd/nview.bat b/build/cmd/nview.bat index c822319e0..1ad60cbee 100755 --- a/build/cmd/nview.bat +++ b/build/cmd/nview.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\view.ps1 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\view.ps1 %*" \ No newline at end of file diff --git a/build/cmd/stats.bat b/build/cmd/stats.bat index ebd95a265..7039189a0 100755 --- a/build/cmd/stats.bat +++ b/build/cmd/stats.bat @@ -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" diff --git a/build/cmd/swarm_batch.bat b/build/cmd/swarm_batch.bat index 74c05ccb1..a0c6f1088 100644 --- a/build/cmd/swarm_batch.bat +++ b/build/cmd/swarm_batch.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -pwsh-preview -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\swarm_batch.ps1 %*" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\swarm_batch.ps1 %*" \ No newline at end of file diff --git a/build/cmd/swarm_help.bat b/build/cmd/swarm_help.bat index 0b3790a21..c3acf0cc1 100755 --- a/build/cmd/swarm_help.bat +++ b/build/cmd/swarm_help.bat @@ -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" diff --git a/build/cmd/version.bat b/build/cmd/version.bat index d20672708..0f7cbfbc9 100755 --- a/build/cmd/version.bat +++ b/build/cmd/version.bat @@ -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%" \ No newline at end of file +pwsh -ExecutionPolicy Bypass -command "set-location ""%SWARM_DIR%\build\powershell\scripts""; .\version.ps1 -command !%arg1% -name !%arg2% -version !%arg3% -uri !%arg4%" \ No newline at end of file diff --git a/build/powershell/control/launchcode.psm1 b/build/powershell/control/launchcode.psm1 index d6e9744aa..8c77000b9 100755 --- a/build/powershell/control/launchcode.psm1 +++ b/build/powershell/control/launchcode.psm1 @@ -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 diff --git a/build/powershell/scripts/get.ps1 b/build/powershell/scripts/get.ps1 index c679a75dc..db6b56342 100755 --- a/build/powershell/scripts/get.ps1 +++ b/build/powershell/scripts/get.ps1 @@ -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" diff --git a/build/powershell/scripts/swarmon.ps1 b/build/powershell/scripts/swarmon.ps1 index 1c9ba6adc..7e5639437 100755 --- a/build/powershell/scripts/swarmon.ps1 +++ b/build/powershell/scripts/swarmon.ps1 @@ -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 diff --git a/h-run.sh b/h-run.sh index c026814d2..66971c3d0 100755 --- a/h-run.sh +++ b/h-run.sh @@ -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 diff --git a/help/Change.log b/help/Change.log index 87f80bb1d..bd0fc50e6 100755 --- a/help/Change.log +++ b/help/Change.log @@ -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. @@ -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 @@ -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 diff --git a/help_linux b/help_linux index 0e32cf7d2..febb4e58b 100755 --- a/help_linux +++ b/help_linux @@ -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`` @@ -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" diff --git a/install_linux b/install_linux index c6931bbc6..1b41ab455 100755 --- a/install_linux +++ b/install_linux @@ -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 @@ -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" diff --git a/startup.ps1 b/startup.ps1 index e3816b4d1..a1c9492d2 100755 --- a/startup.ps1 +++ b/startup.ps1 @@ -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" diff --git a/swarm.ps1 b/swarm.ps1 index 5a1407567..35163554e 100755 --- a/swarm.ps1 +++ b/swarm.ps1 @@ -90,13 +90,13 @@ if ($IsWindows) { } ## Check Powershell version. Output warning. -if ($PSVersionTable.PSVersion -ne "7.0.0-rc.3") { +if ($PSVersionTable.PSVersion -ne "7.0.0") { Write-Host "WARNING: Powershell Core Version is $($PSVersionTable.PSVersion)" -ForegroundColor Red - Write-Host "Currently supported version for SWARM is 7.0.0-rc.3" -ForegroundColor Red + Write-Host "Currently supported version for SWARM is 7.0.0" -ForegroundColor Red Write-Host "SWARM will continue anyways- It may cause issues." -ForegroundColor Red Write-Host "" Write-Host "Link for Powershell:" -ForegroundColor Red - Write-Host "https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.3" -ForegroundColor Red + Write-Host "https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0" -ForegroundColor Red Write-Host "" Write-Host "Windows: Microsoft Visual C++ Redistributable for Visual Studio (2012) (2013) (2015,2017 and 2019)" -ForegroundColor Red Write-Host "Link For download:" -ForegroundColor Red