Skip to content

Instantly share code, notes, and snippets.

@pushrbx
Last active May 15, 2022 12:40
Show Gist options
  • Save pushrbx/54ebcb684183d6163d8601b1df47a1e7 to your computer and use it in GitHub Desktop.
Save pushrbx/54ebcb684183d6163d8601b1df47a1e7 to your computer and use it in GitHub Desktop.
# powershell profile for oh-my-posh if you install it with winget, otherwise you need to import the oh-my-posh module
Import-Module posh-git
$ohmyposhversion = $(oh-my-posh --version)
$ohmyposhthemepath = "~/.oh-my-posh/themes/agnoster/v$ohmyposhversion"
# download a theme if not yet downloaded
if ((test-path $ohmyposhthemepath) -ne $true) {
new-item -itemType Directory -force -path $ohmyposhthemepath
$dwlurl = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$ohmyposhversion/themes/agnoster.omp.json"
$themeFilePath = join-path -path $ohmyposhthemepath -childpath "agnoster.omp.json"
invoke-webrequest -uri $dwlurl -outfile $themeFilePath
}
oh-my-posh --init --shell pwsh --config "$ohmyposhthemepath/agnoster.omp.json" | Invoke-Expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment