-
Install Windows Terminal, PowerShell 7+, Oh My Posh (using Chocolatey)
choco install oh-my-posh
-
Install Nerd Font
oh-my-posh font install meslo
-
Configure Windows Terminal to use your Nerd Font by going to
Settings
->Profiles: Defaults
->Appearance
->Font face
-
Install PS Module dependencies
Install-Module -Name Terminal-Icons -Repository PSGallery
-
Edit your PowerShell profile script (
Microsoft.PowerShell_profile.ps1
) and replace with gist file:code $PROFILE
-
Reload your profile for the changes to take effect.
. $PROFILE
-
Profit 🔥
Last active
February 20, 2025 08:08
-
-
Save gowon/49800552ce330a801f2723d2e103c253 to your computer and use it in GitHub Desktop.
Custom PowerShell Profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref: https://github.com/PowerShell/PSReadLine | |
# ref: https://github.com/devblackops/Terminal-Icons | |
Import-Module -Name PSReadLine,Terminal-Icons | |
# Add Predictive IntelliSense using prompt history in a list view | |
# ref: https://www.hanselman.com/blog/adding-predictive-intellisense-to-my-windows-terminal-powershell-prompt-with-psreadline | |
# ref: https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/ | |
Set-PSReadLineOption -PredictionSource History | |
Set-PSReadLineOption -PredictionViewStyle ListView | |
Set-PSReadLineOption -EditMode Windows | |
# PowerShell parameter completion shim for the dotnet CLI | |
# ref: https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#powershell | |
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock { | |
param($wordToComplete, $commandAst, $cursorPosition) | |
dotnet complete --position $cursorPosition "$commandAst" | ForEach-Object { | |
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) | |
} | |
} | |
# ref: https://ohmyposh.dev/docs | |
# favorite themes: night-owl, thecyberden, unicorn | |
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/night-owl.omp.json" | Invoke-Expression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment