devAlice
← Windows

PowerShell 7 + oh-my-posh + Modules — Save an Hour a Week in the Windows Terminal

Daily-driver PowerShell 7 environment in Windows Terminal — pwsh install, profile, oh-my-posh theme, six essential modules.

Windows's built-in PowerShell 5.1 isn't cross-platform and has many module compatibility issues. PowerShell 7 (pwsh) is the standard. Pair it with oh-my-posh and six modules to match (or beat) macOS's zsh + starship.

This guide is a 30-minute PowerShell setup after Windows initial setup has installed winget.

TL;DR

  1. Install pwsh 7winget install Microsoft.PowerShell
  2. Make pwsh the default Windows Terminal shell
  3. Activate Profile — edit $PROFILE
  4. oh-my-posh — prompt (Git status / exec time / exit code)
  5. Six modules — Terminal-Icons / posh-git / PSReadLine / z / PSFzf / CompletionPredictor

Prerequisites

  • Windows 10/11 with winget (Windows initial setup)
  • Windows Terminal installed (winget or MS Store)
  • A Nerd Font (for oh-my-posh glyphs)

1. Install PowerShell 7

winget install --id Microsoft.PowerShell -e

Open a new tab and run pwsh. Confirm:

$PSVersionTable.PSVersion
# Major: 7, Minor: 4+

2. Make pwsh the Default Shell

Windows Terminal → Settings (Ctrl+,) → Startup:

  • Default profile: PowerShell (7) — the deep-blue icon (not 5.1)

3. Set Up the Profile

# Profile file path
$PROFILE
# C:\Users\me\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
 
# Create if missing
if (-not (Test-Path $PROFILE)) { New-Item -Type File -Path $PROFILE -Force }
 
# Edit
notepad $PROFILE
# or
code $PROFILE

4. Install oh-my-posh

winget install JanDeDobbeleer.OhMyPosh -s winget

New terminal → preview themes:

Get-PoshThemes

If arrows/∋/exec time render as boxes, you're missing a Nerd Font:

  • JetBrainsMono Nerd Font or
    oh-my-posh font install JetBrainsMono
  • Windows Terminal → Settings → Profile → Appearance → Font face: JetBrainsMono Nerd Font

4.1 Add to Profile

Append to $PROFILE:

# Activate oh-my-posh
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression

Themes are personal taste (jandedobbeleer, paradox, negligible, craver, etc.). All themes live in $env:POSH_THEMES_PATH.

5. Six Modules

# All at once
Install-Module -Name Terminal-Icons, posh-git, PSReadLine, z, PSFzf -Scope CurrentUser -Force
Install-Module -Name CompletionPredictor -AllowPrerelease -Scope CurrentUser -Force

5.1 Register in Profile

In $PROFILE:

# 5.1 Icons (file-type icons in ls output)
Import-Module Terminal-Icons
 
# 5.2 posh-git (Git status in prompt)
Import-Module posh-git
# If your oh-my-posh theme already has git status, this may duplicate. Pick one.
 
# 5.3 PSReadLine (bash-style keys, history, completion color)
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Chord Tab -Function Complete  # bash-style
 
# 5.4 z (jump to frequent dirs — 'z proj')
Import-Module z
 
# 5.5 PSFzf (Ctrl+R history, Ctrl+T file search)
Import-Module PSFzf
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
# fzf itself: winget install junegunn.fzf
 
# 5.6 CompletionPredictor (command-based tab predictions)
Import-Module CompletionPredictor

6. Aliases / Functions

Append your own to $PROFILE:

# ls alternatives (UNIX-friendly)
Set-Alias ll Get-ChildItem
function la { Get-ChildItem -Force @args }
 
# Fast reload
function reload-profile { . $PROFILE }
 
# Instant admin shell
function admin { Start-Process pwsh -Verb RunAs }
 
# Git shortcuts
function gs { git status -sb }
function gd { git diff $args }
function gpl { git pull --rebase --autostash }
 
# Quick WSL
function w { wsl @args }

7. Verification

# Reload profile
. $PROFILE
 
# 1. oh-my-posh prompt — cd to a Git repo to see the branch
cd C:\Users\me\Documents\my-repo
 
# 2. PSReadLine — up-arrow history, type and see gray suggestion → press → to accept
git st<→ key>   # is 'status' predicted?
 
# 3. z — jump to a previously visited folder
z my-repo
 
# 4. Ctrl+R — interactive history search (fzf)
 
# 5. ll — colorful ls with Terminal-Icons

Troubleshooting

oh-my-posh shows boxes instead of icons

Nerd Font not applied. Windows Terminal → Settings → Profile → Appearance → set a Nerd Font.

Install-Module permission error

  • First time: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  • Omitting -Scope CurrentUser sometimes prompts admin

Profile not loading

  • pwsh vs Windows Terminal launching PowerShell 5.1 (powershell.exe) have different profile paths
  • 5.1: ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
  • 7: ~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1
  • Confirm with $PSVersionTable.PSVersion

posh-git is slow (big repo)

git status on every prompt is slow in big monorepos. If oh-my-posh theme already has a git segment, disable posh-git or set $GitPromptSettings.EnableFileStatus = $false.

Ctrl+R doesn't work

  • fzf not installed — winget install junegunn.fzf
  • PSFzf installed but fzf.exe missing from PATH

Only grayscale colors

Windows Terminal color scheme set wrong. Settings → switch scheme to Campbell or One Half Dark.

References

Changelog

  • 2026-05-12: First draft. pwsh 7 + oh-my-posh + six modules + aliases/functions + five troubleshooting cases.

Comments