Nice Front-End / Node Development Environment on Windows 10 Setup with VS Code, Cmder, PowerShell, Posh-Git, Oh-My-Posh, and Powerline Fonts
I work as a full stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
For source control, I use git for my spikes since our main source control at work is still using hosted TFS on Visual Studio Team Services.
My editor of choice nowadays is VS Code which is lightweight, customizable and all around a good environment to do development for AngularJS, Angular, NodeJS and other spikings in general. I've also done some .NET Core developments on the editor which is supported quite well including debugging if you follow that style of development. VS Code customization is a large topic by itself, so I won't be writing about it here... Perhaps some other time...
For now, we'll focus on customizing Cmder, Powershell with git, posh-git, oh-my-posh and the Powerline fonts, specifically on how I setup mine which will net you something like the figure below.
A lot of people has written up about customizing PowerShell but I can only find bits and pieces. This article hopefully will combine those bits and pieces into a more coherent end-to-end story.
If you are already on Windows 10, you can skip this section.
If not, you will need to make sure you have PowerShellGet installed. We will use it to pull PS Modules from PS Gallery. Instruction on how to get PowerShellGet can be found here.
I use Chocolatey as my install manager. To install Chocolatey, do the following from within PowerShell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -ForcePowerShell might complains. If so you probably need to change RemoteSigned to ByPass or Unrestricted. Running Get-ExecutionPolicy from inside PowerShell will tell you what to change it to.
Afterward, run the following and wait for it to finish:
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iexIf you already have git installed, you can skip this part.
Otherwise, run the following to install Git from PowerShell:
cinst git.install -yIf you already have Cmder installed, you can skip this part.
Otherwise, run the following to install Cmder from PowerShell:
cinst cmder -yInstallation instruction here...
Set-Theme agnosterClone the powerline repository from GitHub.
git clone https://github.com/powerline/fonts.gitafterward, do the following:
cd fonts
.\install.ps1Wait for all the fonts to be installed.
From inside Cmder / ConEmu settings dialog, ensure you choose the powerline font you wish to used. i.e. Menslo ... for Powerline, etc. Also make sure you set the same font for the Alternative font to use, otherwise some characters will not show.
- Add the following function (stole from here) to your powerline $PROFILE. To edit your $PROFILE, just run
ise $PROFILEfrom within PowerShell:
function U
{
param
(
[int] $Code
)
if ((0 -le $Code) -and ($Code -le 0xFFFF))
{
return [char] $Code
}
if ((0x10000 -le $Code) -and ($Code -le 0x10FFFF))
{
return [char]::ConvertFromUtf32($Code)
}
throw "Invalid character code $Code"
}- Run the following script inside PowerShell:
Write-Host "$(U 0xE0B0) $(U 0x00B1) $(U 0xE0A0) $(U 0x27A6) $(U 0x2718) $(U 0x26A1) $(U 0x2699)"You should see something like the second line in the figure below:

If you don't see the symbols, please make sure you did the Powerline font installation and Cmder customization as described in section 2.