Created
January 13, 2022 17:57
-
-
Save saman-taghavi/b4a0fc25b21c68e19c95bacc41bf0bf7 to your computer and use it in GitHub Desktop.
Well this is how i set up my powershell profile for ohmypwsh and auto complete for powershell 7
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
Set-Item -Path Function:prompt -Value $Prompt -Force | |
# get all themes | |
$themes = Get-ChildItem -Path "~\AppData\Local\Programs\oh-my-posh\themes\*" -Include '*.omp.json' | Sort-Object Name | |
# get a rendom theme | |
$theme = Get-Random -InputObject $themes.Name | |
# initiate ohmyposh | |
oh-my-posh --init --shell pwsh --config ~/AppData/Local/Programs/oh-my-posh/themes/$theme | Invoke-Expression | |
# these are for auto complete of commands previously used | |
Import-Module PSReadLine | |
Set-PSReadLineOption -PredictionSource History | |
Set-PSReadLineOption -PredictionViewStyle ListView | |
Set-PSReadLineOption -EditMode Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment