A place to store my Powershell profile so I don't have to reinvent the wheel every time I get a fresh copy of Windows
Get Windows Terminal.
Update Powershell to at least 7.0
winget install Microsoft.Powershell
Make sure Windows Terminal runs pwsh.exe
in its profile, which is PATH
'd to 7.0.
The default of %windir%\System32\WindowsPowerShell\v1.0\powershell.exe
runs 5.0
Run $PSVersionTable
to check the version
Clone this repo into the folder containing the profile $profile.CurrentUserCurrentHost
.
Probably ~\Documents\PowerShell
.
See about_Profiles.
Then run Setup.ps1
which will install the following:
- oh-my-posh and Hack Nerd Font.
- Zlocation. It's like autojump.
- Powershell Git Aliases. This imitates the legendary Z shell plugin. ggl = git pull, ggp = push, etc
- PSCX. PSCX replaces the pager with
less
which is way better thanmore
(you think I wouldn't want to scroll backward?) - Posh-Git which adds tab completion for
git checkout
and more.
Then configure Windows Terminal to use Hack Nerd Font.
You might have to refresh the terminal if Setup.ps1
fails to call the oh-my-posh
command, since it may not be in the PATH yet.
I could automate this but I'm too lazy.
How often am I going to get a new Windows OS?
The theme is derived from powerlevel10k_lean.
If you use Miniconda to manage Python, create a new Windows Terminal profile with this for "Command line":
pwsh.exe -ExecutionPolicy ByPass -NoExit -Command "(& '~\miniconda3\Scripts\conda.exe' 'shell.powershell' 'hook') | Out-String | ?{$_} | Invoke-Expression; conda activate py312"
where the startup environment is py312
, created with conda create -n py312 python=3.12
.