Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save yadianfdez07/6a62114d8b34bf9115aa20e95b95ead0 to your computer and use it in GitHub Desktop.

Select an option

Save yadianfdez07/6a62114d8b34bf9115aa20e95b95ead0 to your computer and use it in GitHub Desktop.
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Installing Powerline fontts

How to test if Powerline is correctly installed in Cmder / ConEmu:

  1. Add the following function to your powerline $PROFILE:
function U
{
    param
    (
        [int] $Code
    )
 
    if ((0 -le $Code) -and ($Code -le 0xFFFF))
    {
        return [char] $Code
    }
 
    if ((0x10000 -le $Code) -and ($Code -le 0x10FFFF))
    {
        return [char]::ConvertFromUtf32($Code)
    }
 
    throw "Invalid character code $Code"
}

stole from here [https://mnaoumov.wordpress.com/2014/06/14/unicode-literals-in-powershell/].

  1. Run the following script inside PowerShell:
Write-Host "$(U 0xE0B0) $(U 0x00B1) $(U 0xE0A0) $(U 0x27A6) $(U 0x2718) $(U 0x26A1) $(U 0x2699)"

You should see something like the following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment