Skip to content

This is an advanced, performance-optimized PowerShell profile for Windows 11, designed to supercharge the terminal experience for developers and power users. It features a unified package manager, a rich and informative prompt, extensive utility functions, Git shortcuts, and robust error handling. The profile integrates modern tools like oh-my-posh

License

Notifications You must be signed in to change notification settings

Maigi31/Advanced-Powershell-Profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell Profile for the Advanced User

PowerShell Version License Platform

A high-performance, keyboard-driven PowerShell profile designed for developers and power users who value speed and efficiency. This profile minimizes startup time while providing powerful, context-aware functions and integrations. It's built to be resilient, gracefully disabling features if their dependencies are not met.

PowerShell Prompt

Core Features

  • Instantaneous Startup: A lean, custom-built prompt and lazy-loading of non-essential functions ensure your shell is ready instantly.
  • Keyboard-First Workflow: Deep integration with fzf for fuzzy searching files, directories, and command history without leaving the keyboard.
  • Advanced Git Tooling: Interactive, fzf-powered Git commands for lightning-fast log diving, branch switching, and file checkouts.
  • Dynamic Project Environments: Automatically load project-specific .env files and manage Docker containers with simple, interactive commands.
  • Powerful Diagnostics: Quickly find resource-hogging processes and identify which application is using a specific port.
  • Resilient by Design: Automatically detects missing dependencies (like fzf or docker) and disables the relevant features without breaking your shell.

Prerequisites

  • PowerShell 7.2+
  • Git
  • A Nerd Font: Recommended for the best visual experience with icons. FiraCode Nerd Font is a great choice.

Optional Dependencies

  • fzf: A command-line fuzzy finder. Required for all advanced search and interactive Git features. Installation Guide.
  • Docker Desktop: Required for the dexec command.

Installation

  1. Find your PowerShell profile path by running this command:
    $PROFILE
  2. Clone this repository or download the Microsoft.PowerShell_profile.ps1 script into that path. If the directory doesn't exist, create it.
  3. Install Essential Modules: Open a new PowerShell terminal and run the following command to install posh-git, PSReadLine, and Terminal-Icons:
    Install-Module -Name posh-git, PSReadLine, Terminal-Icons -Scope CurrentUser -Force -AcceptLicense
  4. Restart your PowerShell terminal. The new profile will be loaded.

Cheatsheet & Usage

Keybindings (fzf required)

Keybinding Action
Ctrl+r Fuzzy search command history.
Ctrl+f Fuzzy find a file in the current directory tree and insert its path.
Alt+c Fuzzy find a subdirectory and cd into it.

Core Aliases & Functions

Command Description
ll, la List directory contents (with hidden).
.., ... Navigate up one or two directories.
ep Edit your PowerShell profile in VS Code.
rp Reload your PowerShell profile.
mkcd <dir> Create a directory and enter it.
cpy <text> Copy text to the clipboard.

Advanced Tooling (Dependencies required)

Command Description Dependency
fig Fuzzy Interactive Git log viewer. fzf
fib Fuzzy Interactive Branch switcher. fzf
fic Fuzzy Interactive Checkout for a modified file. fzf
dexec Interactively exec into a running Docker container. fzf, docker
Set-ProjectEnv Loads environment variables from an .env file in the current directory. -
Get-TopProcesses Show the top 10 processes by CPU usage. Get-TopProcesses -SortBy Memory -
Find-PortUser <port> Find the process that is listening on a specific TCP port. -
Update-AllPackages Update packages from Winget, Chocolatey, Scoop, and PowerShell Gallery. -
Get-SystemHealth Display a quick snapshot of system health (Uptime, CPU, Memory, Disk). -

This profile is designed to be a foundation. Feel free to customize it to fit your unique workflow. Open an issue or a pull request if you have ideas for improvements!

About

This is an advanced, performance-optimized PowerShell profile for Windows 11, designed to supercharge the terminal experience for developers and power users. It features a unified package manager, a rich and informative prompt, extensive utility functions, Git shortcuts, and robust error handling. The profile integrates modern tools like oh-my-posh

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •