Agnoster like “theme” for PowerShell

Victor Alberto Gil
2 min readMay 25, 2017
PowerShell with custom prompt

Maybe you have seen OhMyZsh’s Theme called Agnoster, which looks like this:

Original source at: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

And you may want something similar on your PowerShell console window but you don’t know where to start. Here I will show you how I achieved that similar look as shown in the first picture above.

Normally, the default PowerShell has a sky blue background, and white text, and… is boring. So the steps to replicate the look shown above, are the following:

  1. Change font to let it have special chars to be shown in console, I suggest AnonymicePowerline NF from http://nerdfonts.com, this font shows git glyphs, arrow like text background ending and many more.

2. Change the background color to another one (optional)

3. Enable custom profile script to execute on PowerShell new instance, as this is disabled by default. On Windows 10 you just have to open System Settings, Update & Security, For Developers, PowerShell section and check Change execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts. Finally Apply those changes.

If you have other Windows versions, one of the following will suffice, according to your needs (executed from a PowerShell instance in privileged mode/admin):

Set-ExecutionPolicy Restricted -Scope CurrentUser -Force
Set-ExecutionPolicy AllSigned -Scope CurrentUser -Force
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
Set-ExecutionPolicy Undefined -Scope CurrentUser -Force

4. Final step, create a startup user PS script for your current user, this file should be created/modified at C:\Users\<yourusername>\Documents\WindowsPowerShell\profile.ps1 and paste or add the following lines (it assumes GIT is available globally from command prompt):

Finally, you can customize it as you wish, that is left to your imagination, and of course, you can share it with us in the comments section.

--

--