PowerShell 7 + oh-my-posh + 모듈 셋업 — Windows 터미널 일주일에 1시간 줄이기
Windows Terminal에서 매일 쓰는 PowerShell 7 환경 — pwsh 설치, profile, oh-my-posh 테마, 핵심 모듈 6종.
Windows 기본 PowerShell 5.1은 cross-platform이 아니고 모듈 호환성 문제가 많다. PowerShell 7 (pwsh) 가 표준. 여기에 oh-my-posh 프롬프트와 모듈 6종을 더하면 macOS의 zsh+starship 조합과 동등하거나 그 이상.
이 가이드는 Windows 초기 셋업에서 winget을 깐 다음 30분 안에 끝나는 PowerShell 환경 셋업이다.
TL;DR
- pwsh 7 설치 —
winget install Microsoft.PowerShell - Windows Terminal 기본 셸 = pwsh 변경
- Profile 활성화 —
$PROFILE편집 - oh-my-posh — 프롬프트 (Git status·실행시간·exit code)
- 모듈 6종 — Terminal-Icons / posh-git / PSReadLine / z / PSFzf / CompletionPredictor
사전 조건
- Windows 10/11 + winget 사용 가능 (Windows 초기 셋업)
- Windows Terminal 설치 (winget 또는 MS Store)
- 폰트: Nerd Font 1개 (oh-my-posh 아이콘용)
1. PowerShell 7 설치
winget install --id Microsoft.PowerShell -e설치 후 새 터미널 탭에서 pwsh 실행. 버전 확인:
$PSVersionTable.PSVersion
# Major: 7, Minor: 4+2. Windows Terminal 기본 셸 = pwsh
Windows Terminal → 설정(Ctrl+,) → Startup:
- Default profile: PowerShell (7) — 아이콘이 진한 파랑인 쪽 (5.1 아닌 7)
3. Profile 셋업
# Profile 파일 위치 확인
$PROFILE
# C:\Users\me\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
# 파일 없으면 생성
if (-not (Test-Path $PROFILE)) { New-Item -Type File -Path $PROFILE -Force }
# 편집
notepad $PROFILE
# 또는
code $PROFILE4. oh-my-posh 설치
winget install JanDeDobbeleer.OhMyPosh -s winget설치 후 새 터미널 → 테마 미리보기:
Get-PoshThemes화살표·∋·실행시간 등이 깨져 보이면 Nerd Font 누락:
- JetBrainsMono Nerd Font 또는
oh-my-posh font install JetBrainsMono - Windows Terminal → 설정 → 프로필 → Appearance → Font face:
JetBrainsMono Nerd Font
4.1 프로필에 추가
$PROFILE 에 다음 추가:
# oh-my-posh 활성화
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression테마는 취향대로 (jandedobbeleer, paradox, negligible, craver 등). 모든 테마는 $env:POSH_THEMES_PATH 폴더에.
5. 모듈 6종
# 모두 한 번에
Install-Module -Name Terminal-Icons, posh-git, PSReadLine, z, PSFzf -Scope CurrentUser -Force
Install-Module -Name CompletionPredictor -AllowPrerelease -Scope CurrentUser -Force5.1 프로필에 등록
$PROFILE 에:
# 5.1 Icons (ls 결과에 파일 타입 아이콘)
Import-Module Terminal-Icons
# 5.2 posh-git (Git status를 프롬프트에)
Import-Module posh-git
# oh-my-posh 테마에 이미 Git status가 있으면 중복일 수 있음. 둘 중 하나 선택.
# 5.3 PSReadLine (bash 스타일 단축키, 히스토리, 자동완성 컬러)
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Chord Tab -Function Complete # bash 스타일
# 5.4 z (디렉토리 점프 — 'z proj' 으로 자주 가는 경로)
Import-Module z
# 5.5 PSFzf (Ctrl+R 히스토리·Ctrl+T 파일 검색)
Import-Module PSFzf
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
# fzf 자체도 필요: winget install junegunn.fzf
# 5.6 CompletionPredictor (탭 자동완성 예측 — 명령어 기반)
Import-Module CompletionPredictor6. 자주 쓰는 alias / 함수
$PROFILE 끝에 자기 명령:
# ls 대체 (UNIX 친화)
Set-Alias ll Get-ChildItem
function la { Get-ChildItem -Force @args }
# 빠른 reload
function reload-profile { . $PROFILE }
# 즉시 admin 셸
function admin { Start-Process pwsh -Verb RunAs }
# Git 단축
function gs { git status -sb }
function gd { git diff $args }
function gpl { git pull --rebase --autostash }
# WSL 빠른 진입
function w { wsl @args }7. 검증
# Profile reload
. $PROFILE
# 1. oh-my-posh 프롬프트 표시 — Git repo로 cd 시 브랜치 표시
cd C:\Users\me\Documents\my-repo
# 2. PSReadLine — 위 화살표로 히스토리, 입력하다 회색 예측 → → 키로 수락
git st<→키> # status가 예측되는지
# 3. z — 자주 갔던 폴더로 점프
z my-repo
# 4. Ctrl+R — 히스토리 인터랙티브 검색 (fzf)
# 5. ll — Terminal-Icons 적용된 컬러 ls트러블슈팅
oh-my-posh 아이콘이 □로 보임
Nerd Font 미적용. Windows Terminal → 설정 → 프로필 → Appearance → Font에 Nerd Font 지정.
Install-Module 권한 에러
- 처음이라면
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned한 번 -Scope CurrentUser빠뜨려서 admin 필요한 경우 있음
Profile이 안 로드됨
pwsh실행 시 vs Windows Terminal에서 PowerShell 5.1 (powershell.exe) 실행 시 Profile 경로가 다름- 5.1 Profile:
~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 - 7 Profile:
~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 - 7로 사용 중인지
$PSVersionTable.PSVersion확인
posh-git이 느림 (큰 repo)
큰 monorepo에서 매 prompt마다 git status가 느림. oh-my-posh 테마에 git segment 있으면 posh-git 비활성화 또는 $GitPromptSettings.EnableFileStatus = $false.
Ctrl+R이 작동 안 함
fzf미설치 —winget install junegunn.fzf- PSFzf 모듈은 깔았지만 PATH에 fzf.exe 없음
색상이 회색만 나옴
Windows Terminal의 컬러스킴이 잘못 잡힌 경우. 설정 → 색 구성표를 Campbell 또는 One Half Dark 로.
참고
- Windows 초기 셋업 — winget 사전 셋업
- WSL2 튜닝 — Linux 셸 셋업 (zsh)
- oh-my-posh 공식
- PowerShell Gallery — 모듈 탐색
변경 이력
- 2026-05-12: 첫 작성. pwsh 7 + oh-my-posh + 모듈 6종 + alias/함수 + 트러블슈팅 5종.