A complete, copy-pasteable solution for your PowerShell Developer Profile.
Integrates Oh My Posh, PSReadLine, and custom aliases for Laravel (Artisan) and Git.
- Prerequisites
- Step 1: Install Required Tools
- Step 2: Configure Terminal Font
- Step 3: Create Your Profile
- Step 4: The Profile Script
- Step 5: Apply and Enable
- Alias Quick Reference
- Pro Tips
- Troubleshooting
Before you begin, ensure you have the following installed:
| Requirement | Description | Check Command |
|---|---|---|
| Windows 10/11 | Windows Terminal recommended | - |
| PowerShell 7+ | Modern PowerShell (not Windows PowerShell 5.1) | $PSVersionTable.PSVersion |
| Winget | Windows Package Manager | winget --version |
| Git | For Git aliases to work | git --version |
| PHP (optional) | For Laravel/Artisan aliases | php --version |
π‘ Tip: Install PowerShell 7+ via:
winget install Microsoft.PowerShell
Open PowerShell as Administrator and run these commands:
# Install Oh My Posh - the prompt theme engine
winget install JanDeDobbeleer.OhMyPosh -s winget# Install the MesloLGM NF Nerd Font (Required for icons to display correctly)
oh-my-posh font install meslo
β οΈ Important: Without a Nerd Font, icons will appear as broken boxesβ‘β‘β‘
You must change your terminal font to MesloLGM NF for icons to render properly.
- Open Settings (
Ctrl + ,) - Navigate to Profiles β Defaults β Appearance
- Set Font face to
MesloLGM NF - (Optional) Set font size to
12for best readability
- Open Settings (
Ctrl + ,) - Search for
terminal.integrated.fontFamily - Set value to
MesloLGM NF
// settings.json
{
"terminal.integrated.fontFamily": "MesloLGM NF",
"terminal.integrated.fontSize": 14
}π‘ Tip: Restart your terminal after changing fonts for changes to take effect.
The PowerShell Profile is a script that runs every time you open a new terminal window.
# Check your profile path
echo $PROFILEif (!(Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}notepad $PROFILEπ‘ Tip: You can also use VS Code:
code $PROFILE
Copy and paste the entire block below into your profile file.
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# β π Developer PowerShell Profile β
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 1. PSReadLine Configuration (Command Intelligence)
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Import PSReadLine module for enhanced command-line editing
Import-Module PSReadLine -ErrorAction SilentlyContinue
# Enable predictive IntelliSense based on command history
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -HistorySaveStyle SaveIncrementally
Set-PSReadLineOption -MaximumHistoryCount 50000
# Arrow keys search through history for matching commands
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# Ctrl+R for reverse search (like bash)
Set-PSReadLineKeyHandler -Chord Ctrl+r -Function ReverseSearchHistory
# Tab completion with visual menu
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 2. Oh My Posh Theme (Terminal UI)
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Initialize Oh My Posh with the 'illusi0n' theme
# Browse themes: https://ohmyposh.dev/docs/themes
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\illusi0n.omp.json" | Invoke-Expression
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 3. Git Aliases & Functions
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function g-status { git status }
Set-Alias -Name gs -Value g-status -Description "Git status"
function g-add { git add $args }
Set-Alias -Name ga -Value g-add -Description "Git add"
function g-add-all { git add . }
Set-Alias -Name gaa -Value g-add-all -Description "Git add all"
function g-commit {
param([string]$Message)
git commit -m $Message
}
Set-Alias -Name gc -Value g-commit -Description "Git commit"
function g-commit-amend { git commit --amend }
Set-Alias -Name gca -Value g-commit-amend -Description "Git commit amend"
function g-pull { git pull }
Set-Alias -Name gl -Value g-pull -Description "Git pull"
function g-push { git push }
Set-Alias -Name gp -Value g-push -Description "Git push"
function g-push-force { git push --force-with-lease }
Set-Alias -Name gpf -Value g-push-force -Description "Git push force (safe)"
function g-branch { git branch $args }
Set-Alias -Name gb -Value g-branch -Description "Git branch"
function g-checkout { git checkout $args }
Set-Alias -Name gco -Value g-checkout -Description "Git checkout"
function g-log { git log --oneline --graph --decorate -20 }
Set-Alias -Name glog -Value g-log -Description "Git log (pretty)"
function g-diff { git diff $args }
Set-Alias -Name gd -Value g-diff -Description "Git diff"
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 4. Laravel / Artisan Aliases
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function pa { php artisan $args }
Set-Alias -Name art -Value pa -Description "PHP Artisan"
function pa-migrate { php artisan migrate }
Set-Alias -Name pam -Value pa-migrate -Description "Artisan migrate"
function pa-migrate-fresh { php artisan migrate:fresh --seed }
Set-Alias -Name pamf -Value pa-migrate-fresh -Description "Artisan fresh migrate with seed"
function pa-tinker { php artisan tinker }
Set-Alias -Name pat -Value pa-tinker -Description "Artisan tinker"
function pa-serve { php artisan serve }
Set-Alias -Name pas -Value pa-serve -Description "Artisan serve"
function pa-cache-clear {
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
Write-Host "β
All caches cleared!" -ForegroundColor Green
}
Set-Alias -Name pacc -Value pa-cache-clear -Description "Clear all Laravel caches"
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 5. Node.js / NPM Aliases
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
function npm-dev { npm run dev }
Set-Alias -Name nd -Value npm-dev -Description "NPM run dev"
function npm-build { npm run build }
Set-Alias -Name nb -Value npm-build -Description "NPM run build"
function npm-install { npm install }
Set-Alias -Name ni -Value npm-install -Description "NPM install"
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 6. Utility Functions
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Profile Management
function Edit-Profile { code $PROFILE }
Set-Alias -Name ep -Value Edit-Profile -Description "Edit profile in VS Code"
function Reload-Profile {
. $PROFILE
Write-Host "β
Profile reloaded!" -ForegroundColor Green
}
Set-Alias -Name rp -Value Reload-Profile -Description "Reload profile"
# Quick Navigation
function Go-Projects { Set-Location "C:\Projects" }
Set-Alias -Name cdp -Value Go-Projects -Description "Go to Projects folder"
function Go-Desktop { Set-Location "$env:USERPROFILE\Desktop" }
Set-Alias -Name cdd -Value Go-Desktop -Description "Go to Desktop"
# System Utilities
function Get-PublicIP { (Invoke-WebRequest -Uri "https://api.ipify.org").Content }
Set-Alias -Name myip -Value Get-PublicIP -Description "Get public IP"
function Clear-RecycleBin { Clear-RecycleBin -Force -ErrorAction SilentlyContinue }
Set-Alias -Name emptytrash -Value Clear-RecycleBin -Description "Empty recycle bin"
# File Operations
function touch {
param([string]$Path)
if (Test-Path $Path) {
(Get-Item $Path).LastWriteTime = Get-Date
} else {
New-Item -ItemType File -Path $Path -Force | Out-Null
}
}
function mkcd {
param([string]$Path)
New-Item -ItemType Directory -Path $Path -Force | Out-Null
Set-Location $Path
}
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 7. Welcome Message
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Write-Host ""
Write-Host " π Developer PowerShell Profile Loaded" -ForegroundColor Cyan
Write-Host " π Type 'ep' to edit profile | 'rp' to reload" -ForegroundColor DarkGray
Write-Host ""Press Ctrl + S to save the file, then close Notepad.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserπ Security Note:
RemoteSignedonly allows local scripts to run. Downloaded scripts must be signed.
. $PROFILEOr simply close and reopen your terminal.
| Alias | Command | Description |
|---|---|---|
gs |
git status |
Check repository status |
ga |
git add <files> |
Stage files |
gaa |
git add . |
Stage all changes |
gc "msg" |
git commit -m "msg" |
Commit with message |
gca |
git commit --amend |
Amend last commit |
gl |
git pull |
Pull from remote |
gp |
git push |
Push to remote |
gpf |
git push --force-with-lease |
Safe force push |
gb |
git branch |
List/create branches |
gco |
git checkout <branch> |
Switch branches |
glog |
git log --oneline |
Pretty log view |
gd |
git diff |
Show differences |
| Alias | Command | Description |
|---|---|---|
art / pa |
php artisan |
Run any artisan command |
pam |
php artisan migrate |
Run migrations |
pamf |
php artisan migrate:fresh --seed |
Fresh DB with seeds |
pat |
php artisan tinker |
Open Tinker REPL |
pas |
php artisan serve |
Start dev server |
pacc |
- | Clear all caches |
| Alias | Command | Description |
|---|---|---|
nd |
npm run dev |
Start dev server |
nb |
npm run build |
Build for production |
ni |
npm install |
Install dependencies |
| Alias | Command | Description |
|---|---|---|
ep |
Opens $PROFILE in VS Code |
Edit your profile |
rp |
Reloads profile | Apply changes |
cdp |
cd C:\Projects |
Go to projects |
cdd |
cd ~/Desktop |
Go to desktop |
myip |
- | Show public IP address |
touch <file> |
- | Create file (like Linux) |
mkcd <dir> |
- | Create and enter directory |
# List all available themes
Get-ChildItem $env:POSH_THEMES_PATH
# Preview a theme
oh-my-posh print primary --config "$env:POSH_THEMES_PATH\{theme-name}.omp.json"Popular themes: agnoster, paradox, powerlevel10k_rainbow, atomic, night-owl
| Shortcut | Action |
|---|---|
β / β |
Search history for current input |
Ctrl + R |
Reverse search history |
Ctrl + A |
Select all |
Ctrl + C |
Cancel current command |
Tab |
Cycle through completions |
Ctrl + Space |
Show all completions |
Ctrl + L |
Clear screen |
Add this to the top of your profile to measure load time:
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
# ... rest of profile ...
$stopwatch.Stop()
Write-Host "Profile loaded in $($stopwatch.ElapsedMilliseconds)ms" -ForegroundColor DarkGrayOnly load modules when needed:
# Load Azure module only when needed
function Load-Azure { Import-Module Az -ErrorAction SilentlyContinue }
# Load Posh-Git for enhanced Git integration
if (Get-Command git -ErrorAction SilentlyContinue) {
Import-Module posh-git -ErrorAction SilentlyContinue
}Create a .psprofile file in project roots:
# Add to your main profile
if (Test-Path ".\.psprofile") { . ".\.psprofile" }# Create a backup
Copy-Item $PROFILE "$PROFILE.backup.$(Get-Date -Format 'yyyyMMdd')"# Terminal-Icons - Adds file icons to directory listings
Install-Module -Name Terminal-Icons -Repository PSGallery -Force
Import-Module Terminal-Icons
# Posh-Git - Enhanced Git integration with status in prompt
Install-Module -Name posh-git -Repository PSGallery -Force
Import-Module posh-git
# Z - Quick directory jumping (like autojump)
Install-Module -Name z -Repository PSGallery -Forcefunction gac {
param([string]$Message)
git add .
git commit -m $Message
Write-Host "β
Committed: $Message" -ForegroundColor Green
}Usage: gac "feat: add new feature"
Solution: Install a Nerd Font and configure your terminal to use it.
oh-my-posh font install mesloSolution: Enable script execution:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserSolution: Restart your terminal after installation, or add to PATH manually:
$env:Path += ";$env:LOCALAPPDATA\Programs\oh-my-posh\bin"Solution: Check if profile exists and path is correct:
Test-Path $PROFILE # Should return True
Get-Content $PROFILE # View profile contentsSolutions:
- Remove unused modules
- Use lazy loading for heavy modules
- Measure with:
Measure-Command { . $PROFILE }
Solution: Check available themes and use correct path:
# List available themes
Get-ChildItem $env:POSH_THEMES_PATH | Select-Object Name
# Use default theme if yours is missing
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression| Resource | Link |
|---|---|
| Oh My Posh Documentation | ohmyposh.dev/docs |
| Oh My Posh Themes Gallery | ohmyposh.dev/docs/themes |
| PSReadLine Documentation | Microsoft Docs |
| PowerShell 7 Documentation | Microsoft Docs |
| Nerd Fonts | nerdfonts.com |
| Terminal-Icons Module | GitHub |
Made with π for developers who love a beautiful terminal
Last updated: January 2026