Skip to content

Instantly share code, notes, and snippets.

@mikedhanson
Created April 15, 2024 19:35
Show Gist options
  • Save mikedhanson/d36d06e394a6eba8156dab15f142374f to your computer and use it in GitHub Desktop.
Save mikedhanson/d36d06e394a6eba8156dab15f142374f to your computer and use it in GitHub Desktop.
Windows powershell profile
<# PSREADLINE #>
if (Get-Module -Name PSReadLine) {
Import-Module PSReadLine
#Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
if ($host.Version.Major -eq 7) {
#only PS 7 supports HistoryAndPlugin
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
}
else {
#use history as the prediction source on 5.1
}
}
else {
write-Error "Psreadline module doesnt exist."
}
Import-Module "C:\ProgramData\UniversalAutomation\Repository\Modules\SDTools\1.0.0\SDTools.psm1"
#Set-Location -Path 'C:\'
$ThemesPath = 'C:\Users\<profile>\AppData\Local\Programs\oh-my-posh\themes'
oh-my-posh prompt init pwsh --config $ThemesPath\clean-detailed.omp.json | Invoke-Expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment