14

With PowerShell Core 6.0.0 released I'd like to start using it instead of Windows 10's default PowerShell.

I currently use Cmder for this, which is based upon ConEmu. There are already two PowerShell tasks and I assume that I can update them to point to my local install of PowerShell Core (in C:\Program Files\PowerShell\6.0.0).

I've tried updating the Task parameters for Powershell::Powershell to the following:

/dir "C:\Program Files\PowerShell\6.0.0\" /icon "%CMDER_ROOT%\icons\cmder_blue.ico"

Then I update the commands to this:

"%ProgramFiles%\PowerShell\6.0.0\PowerShell.exe" -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%" -new_console:d:D:\git

However, it's breaking with the following error:

'c:\program' is not recognized as an internal or external command, operable program or batch file.

How would I setup Cmder/ConEmu to call the PowerShell Core version of PowerShell instead of the default installation?

0

3 Answers 3

34

Use

*pwsh -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''"

enter image description here

2
  • Thanks the screen shot helps a ton.
    – user212241
    Commented Jan 17, 2019 at 4:38
  • 1
    The script was throwing error as it was not able to locate the profile.ps1 file. So I change it to pwsh.exe -ExecutionPolicy Bypass
    – nick-s
    Commented Jul 10, 2019 at 23:48
3

I currently use Cmder for this, which is based upon ConEmu. There are already two PowerShell tasks and I assume that I can update them to point to my local install of PowerShell Core (in C:\Program Files\PowerShell\6.0.0).

You are using the wrong executable.

The binary name for PowerShell Core has been changed from powershell(.exe) to pwsh(.exe). This change provides a deterministic way for users to run PowerShell Core on machines to support side-by-side Windows PowerShell and PowerShell Core installations. pwsh is also much shorter and easier to type.

What's New in PowerShell Core 6.0

Additionally

You can launch PowerShell via the Start Menu or $env:ProgramFiles\PowerShell\pwsh.exe

Installing PowerShell Core on Windows

0
0

After installing powershell 7/Core, you can use the ConEmu feature called Add/refresh default tasks to add extra tasks for pwsh. From the documentation:

In case you have installed a new application (for example new Visual Studio version) or new ConEmu build which knows more predefined shells than previous build, the new task is not created automatically by ConEmu without user’s request.

If you want to add missed tasks, or recreate existing tasks with default (recommended) parameters, just open ‘Tasks’ settings page and press ‘Add/recreate default tasks…’ button. ConEmu will confirm the action (‘Yes’ - add missed tasks; ‘No’ - rewrite existing tasks with defaults) and you will get new tasks at the end of the Tasks list!

Note that in cmder the button is actually labelled Add/refresh default tasks... in the Setup tasks dialog.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .