There are number of ways you can install Oh-My-Posh. But commonly you install Oh-My-Posh either from PSGallery by using PowerShell's 'Install-Module' command or with Oh-My-Posh supplied platform-specific install instructions like 'Winget' on their website. Hence you can choose to run any one of the following.
winget install JanDeDobbeleer.OhMyPosh -s winget
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
For the PATH to be reloaded, a restart of your terminal is advised
The path of the module installation depends upon the '-Scope' used in the module installation command above. The acceptable values for this parameter are 'AllUsers' and 'CurrentUser'.
The AllUsers scope installs modules in a location that's accessible to all users of the computer:
$env:ProgramFiles\WindowsPowerShell\Modules
The CurrentUser installs modules in a location that's accessible only to the current user of the computer. For example:
$HOME\Documents\WindowsPowerShell\Modules
When no Scope is defined, the default is set based on the PowerShellGet version. In PowerShellGet versions 2.0.0 and above, the default is CurrentUser, which doesn't require elevation for install. In PowerShellGet 1.x versions, the default is AllUsers, which requires elevation for install.
C:\Windows\System32\WindowsPowerShell
To display every available theme in the current directory, use the following cmdlet.
Get-PoshThemes
The module installs all themes in the module folder. To find the actual files, you can use the following command:
Get-PoshThemes -list
Edit your PowerShell $PROFILE and add the following lines to load Oh-My-Posh module and theme of your choice at startup. Autocompletion is available so it will loop through all available themes. Refer the last section of this gist to know the location of your PowerShell profile.
Import-Module oh-my-posh
Set-PoshPrompt -Theme jandedobbeleer
In order to update oh-my-posh module to latest available version, run one of the following:
winget upgrade JanDeDobbeleer.OhMyPosh -s winget
Update-Module oh-my-posh
Oh My Posh was designed to use Nerd Fonts. Nerd Fonts are popular fonts that are patched to include icons. We recommend Meslo LGS NF, but any Nerd Font should be compatible with the standard themes.
To see the icons displayed in Oh My Posh, install a Nerd Font, and configure your terminal to use it.
AllUsersAllHosts - C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost - C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts - C:\Users\UserName\Documents\WindowsPowerShell\profile.ps1
CurrentUserCurrentHost - C:\Users\UserName\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
CurrentUser - C:\Users\UserName\Documents\WindowsPowerShell\Modules
AllUsersCurrentHost - C:\Program Files\WindowsPowerShell\Modules
BuiltInModules (AllUsers) - C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\