winutil icon indicating copy to clipboard operation
winutil copied to clipboard

Replace Default Powershell 5 to Powershell 7 doesn't work

Open DiegcD opened this issue 1 year ago • 7 comments

Describe the bug

Today I tried with dev branch and stable branch, neither works. I used the tweak to change powershell and it doesn't work, Windows still uses powershell 5 as default. When executing the tweak the powershell status displays:

Running Script for WPFTweaksPowershell7
Powershell 7 is already installed.
Settings file not found at C:\Users\Diego\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
=================================
--     Tweaks are Finished    ---
=================================

Dev branch shows

Running Script for WPFTweaksPowershell7Tele
Running Script for WPFTweaksPowershell7
Powershell 7 is already installed.
Windows Terminal not installed. Skipping Terminal preference
=================================
--     Tweaks are Finished    ---
=================================

To Reproduce

Steps to reproduce the behavior:

  1. Go to Tweaks Tab
  2. Click on Replace Default Powershell 5 to Powershell 7
  3. Click on Run Tweaks
  4. See Tweaks are Finished message
  5. Run powershell again and type $PSVersionTable
  6. Shows powershell 5

Expected behavior

Executing $PSVersionTable should show Powershell 7

Screenshots

If applicable, add screenshots to help explain your problem. Captura de pantalla (163) Captura de pantalla (164)

Additional context

Windows 11 23h2 64bits

DiegcD avatar Jul 19 '24 03:07 DiegcD

The error (from stable) indicates that your settings file is not in the directory the script expects it to be.

May I suggest looking if the settings.json exists in one of following directories:

Terminal (stable / general release):

  • %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json Terminal (preview release): - %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\settings.json Terminal (unpackaged: Scoop, Chocolately, etc):
  • %LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json

according to stackoverflow and microsoft learn

MyDrift-user avatar Jul 19 '24 06:07 MyDrift-user

The error (from stable) indicates that your settings file is not in the directory the script expects it to be.

May I suggest looking if the settings.json exists in one of following directories:

Terminal (stable / general release):

* `%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json`
  Terminal (preview release): - `%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\settings.json`
  Terminal (unpackaged: Scoop, Chocolately, etc):

* `%LOCALAPPDATA%\Microsoft\Windows Terminal\settings.json`

according to stackoverflow and microsoft learn

The file is not there in any of those locations, I don't have those folders.

@MyDrift-user I used everything search and it didn't find a settings.json file related to any terminal folder. Only from other software I have installed. The file doesn't exist on my system.

DiegcD avatar Jul 19 '24 06:07 DiegcD

You seem to have the standard terminal application set to windows console host. Have you uninstalled the terminal? Terminal in question: image

MyDrift-user avatar Jul 19 '24 07:07 MyDrift-user

The default/required Win11 a Terminal app can be installed via winutil and is called "Windows Terminal" on the application page. Alternatively you have to start "pwsh" instead of "Powershell" to use the Powershell 7.

Marterich avatar Jul 19 '24 17:07 Marterich

You seem to have the standard terminal application set to windows console host. Have you uninstalled the terminal? Terminal in question: image

I did not delete it. My windows iso was created by microwin and i have windows terminal on system32 folder

The default/required Win11 a Terminal app can be installed via winutil and is called "Windows Terminal" on the application page. Alternatively you have to start "pwsh" instead of "Powershell" to use the Powershell 7.

I have the default terminal on system32

DiegcD avatar Jul 19 '24 17:07 DiegcD

Interesting, I think microwin is the culprit again. Nevertheless, could you try uninstalling, reinstalling the windows terminal app and then rerunning the tweak :) Would be nice to know if a clean terminal app installation fixes the problem

Marterich avatar Jul 19 '24 18:07 Marterich

This issue was marked as stale because it has been inactive for 7 days

github-actions[bot] avatar Jul 27 '24 00:07 github-actions[bot]

This issue was closed because it has been inactive for 7 days since it was marked as stale

github-actions[bot] avatar Aug 03 '24 00:08 github-actions[bot]