ChrisTitusTech / winutil

Chris Titus Tech's Windows Utility - Install Programs, Tweaks, Fixes, and Updates
MIT License
20.67k stars 1.28k forks source link

Replace Default Powershell 5 to Powershell 7 doesn't work #2406

Closed DiegcD closed 1 month ago

DiegcD commented 1 month ago

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

MyDrift-user commented 1 month ago

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):

according to stackoverflow and microsoft learn

DiegcD commented 1 month ago

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.

MyDrift-user commented 1 month ago

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

Marterich commented 1 month ago

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.

DiegcD commented 1 month ago

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

Marterich commented 1 month ago

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

github-actions[bot] commented 1 month ago

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

github-actions[bot] commented 1 month ago

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