Skip to content

Windows PowerShell Development Environment Setup

Build a modern Windows command-line environment with PowerShell 7 as the shell, Windows Terminal as the terminal emulator, and PSReadLine, zoxide, and fzf to improve your daily development workflow.

1. Install Windows Terminal

Windows Terminal is a terminal emulator responsible for terminal windows, tabs, fonts, color schemes, and profile management.

Install it using WinGet:

winget install --id Microsoft.WindowsTerminal -e

If Windows Terminal is already installed, WinGet will attempt to upgrade it.

Ways to launch Windows Terminal:

  • Search for Windows Terminal in the Start Menu.
  • Press Win + R, type wt, and press Enter.
  • Run wt from an existing PowerShell session.

2. Install PowerShell 7

Windows includes Windows PowerShell 5.1 by default. PowerShell 7 is a separate, modern version.

PowerShell 7 does not replace PowerShell 5.1. Both versions can coexist.

Install PowerShell 7 using WinGet:

winget install --id Microsoft.PowerShell --source winget

Launch PowerShell 7:

pwsh

Verify the installation:

$PSVersionTable

Make sure PSVersion shows version 7.x.

3. Configure Windows Terminal

Open Windows Terminal and press Ctrl + , to access Settings.

Navigate to Startup:

  1. Find the Default Profile setting.
  2. Select PowerShell 7.
  3. Save your changes.

Windows Terminal will now launch PowerShell 7 by default instead of Windows PowerShell 5.1.

4. Install PSReadLine

PSReadLine is a PowerShell command-line enhancement module that provides:

  • Command history
  • Predictive suggestions
  • Syntax highlighting
  • Enhanced command-line editing

4.1 Install PSReadLine

Run the following command in PowerShell 7:

Install-Module PSReadLine -Scope CurrentUser -Force

4.2 Verify the installation

Get-Module PSReadLine -ListAvailable |
    Select-Object Name, Version

If multiple versions are installed, use the latest available version.

4.3 Configure PSReadLine

Import-Module PSReadLine -MinimumVersion 2.4.5 -Force

# Enable command history prediction
Set-PSReadLineOption -PredictionSource History

# Display suggestions in a list
Set-PSReadLineOption -PredictionViewStyle ListView

# Use Windows-style keyboard shortcuts
Set-PSReadLineOption -EditMode Windows

5. Install zoxide

zoxide is a smarter directory navigation tool. It learns from your directory usage and allows you to jump between frequently visited locations using keywords.

5.1 Install zoxide

winget install --id ajeetdsouza.zoxide -e

5.2 Configure PowerShell integration

After installing zoxide, initialize it in your PowerShell profile.

Open your profile:

notepad $PROFILE

Add the following configuration:

# zoxide
Invoke-Expression (& { (zoxide init powershell | Out-String) })

Save the file and restart PowerShell.

5.3 Common commands

Command Description
z project Jump to a directory matching the keyword
z blog Jump to a previously visited directory matching blog
zi Interactively select a directory
z - Return to the previous directory

Note: zoxide needs to build up directory history before keyword-based navigation becomes useful.

6. Install fzf

fzf is a general-purpose command-line fuzzy finder.

Common use cases include:

  • Searching files and directories
  • Searching command history
  • Interactive filtering of command output

6.1 Install fzf

winget install --id junegunn.fzf -e

6.2 Verify the installation

fzf --version

6.3 Common commands

# Fuzzy search files in the current directory
fzf

# Search PowerShell command history
Get-Content (Get-PSReadLineOption).HistorySavePath | fzf

# Search files recursively in the current directory
Get-ChildItem -Recurse -File |
    Select-Object -ExpandProperty FullName |
    fzf

7. Consolidate PowerShell Profile Configuration

PowerShell Profile is a script that runs automatically whenever PowerShell starts.

You can put all your initialization settings in one place.

7.1 Create the profile

if (!(Test-Path $PROFILE)) {
    New-Item -ItemType File -Path $PROFILE -Force
}

notepad $PROFILE

7.2 Complete configuration

Add the following content to $PROFILE:

# ==========================================
# PSReadLine
# ==========================================

Import-Module PSReadLine -MinimumVersion 2.4.5

Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows


# ==========================================
# zoxide
# ==========================================

Invoke-Expression (& { (zoxide init powershell | Out-String) })

Save the file and restart PowerShell 7.

8. Verify the Complete Environment

Run the following commands to verify each component:

# PowerShell version
$PSVersionTable.PSVersion

# PSReadLine version
Get-Module PSReadLine |
    Select-Object Name, Version

# zoxide version
zoxide --version

# fzf version
fzf --version

# Verify zoxide commands
Get-Command z, zi

Make sure all tools are installed and working correctly.

9. Final Toolchain Overview

Tool Category Purpose
Windows Terminal Terminal Emulator Windows, tabs, and appearance
PowerShell 7 Shell Command execution and scripting
PSReadLine PowerShell Module History prediction and command editing
zoxide CLI Tool Smart directory navigation
fzf CLI Tool Fuzzy finding and interactive filtering

Comments