Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Last active January 28, 2020 15:45
Show Gist options
  • Save mvidaldp/65ca4712eb978a5b1f8ad01f8c0f26cf to your computer and use it in GitHub Desktop.
Save mvidaldp/65ca4712eb978a5b1f8ad01f8c0f26cf to your computer and use it in GitHub Desktop.
Customize your PowerShell's promt "PS1" Oh My Zsh style and show system information

Assuming that you have Git for Windows installed, otherwise install it first via official website, chocolatey, scoop, etc.

1. Install these modules:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

Assuming that you have a PowerShell profile (check by Test-path $profile), otherwise create one by New-item –type file –force $profile.

2. Edit your PowerShell profile and call the modules:

Run notepad $profile and add the next:

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

Note that you can set the theme you want.

3. Automatically display system information on promt:

First install Neofetch for Windows via Scoop:

scoop install neofetch

Then edit your PowerShell profile again (notepad $profile) and add neofetch in the end.

Neofetch also works on CMD. In case you want to adapt the prompt output between PowerShell and CMD so that they share the same high on the same terminal window size, you can always add breaklines by echo " ".

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment