3

In Windows Server Core, after installing version 7 from the msi (7.2.0), there is an expectation that in the documents folder, there should be two folders, one for WindowsPowerShell (version 5) and one for PowerShell (version 7).

While 7.2.0 is installed, the Windows Server Core is starting up with version 5. Looking for a one liner to change that default startup from 5 to 7.

There is no "Settings" link in Windows Server Core. It is command line only.

Is there a command line that will enable this switch from five to seven?

The pwsh.exe is available under C:\Program Files\Powershell\7 as pwsh.exe and launching it produces the expected result. But on startup, this version does not launch.

2
  • 2
    Try Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon' -Name Shell -Value 'C:\Program Files\Powershell\7\pwsh.exe' -- courtesy of msnoob.com/… Commented Nov 9, 2021 at 15:11
  • 2
    Interesting: Shell does not exist in Windows Server Core but the Winlogon for AlternateShells does: [String]=3000 and value is cmd.exe /c "cd /d "%USERPROFILE%" & start cmd.exe /k runonce.exe /AlternateShellStartup" BTW, Trying to run docker on Virtualbox Win 2019 Core rather than HyperV. Not very successfully. Commented Nov 9, 2021 at 15:15

1 Answer 1

1

Checking the Path reveals the PowerShell 7 path is stated. Typing pwsh anywhere at a command line will automatically run version 7 once that path is in place and it appears to be a default for PowerShell 7

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.