Windows – Customizing Powershell to look like Github for Windows’ shell

gitgithubpowershellshellwindows

I use Github for Windows and usually I use the "Open a Shell" here command which launches powershell with some custom settings. It makes powershell display extra information when I'm inside a Git repo like the status of the Repo just before the prompt, having a black background…

However when I use the normal powershell, all those niceties are gone. I would like those changes on the powershell to become the default so that I wouldn't have to launch the custom prompt.

I was wondering if its possible to get those settings at runtime and then apply it permanently. I have been able to make powershell have a black background by default and change the default font but I can't get those extra info on git repositories.

Thanks

Best Answer

There are a few different default places the Powershell profile can be stored. This is where your custom code should be stored, so that every time you open up a new Powershell prompt it applies these settings.

The first location is the global location and would be useful when you want all users to have a customized Powershell profile. This profile should be placed in C:\WINDOWS\system32\WindowsPowerShell\v1.0\Profile.ps1.

The second location is for the local profile and would be specific to each user account. This file overrides the global configuration file and should be placed in C:\Username\My Documents\WindowsPowerShell\Profile.ps1.

As for getting your git stuff working, there are some good blog posts here and here that go over how to customize the profile to make git work better and look pretty. Select the parts of their code/configuration to your own profile to get your git settings up and working the way you want.

Related Question