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.

Jamie
  • 437
  • 4
  • 15
  • 2
    Try `Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon' -Name Shell -Value 'C:\Program Files\Powershell\7\pwsh.exe'` -- courtesy of https://www.msnoob.com/windows-server-core-how-to-start-powershell-by-default.html – zett42 Nov 09 '21 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. – Jamie Nov 09 '21 at 15:15

1 Answers1

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

Jamie
  • 437
  • 4
  • 15