---
id: powershell
title: PowerShell
sidebar_label: PowerShell
---

A package that includes useful helper functions to install and configure Oh my Posh.

:::caution Font icons
For maximum enjoyment, make sure to **install** and **configure** your terminal to use a powerline enabled font.
The fonts we use are patched by [Nerd Fonts][nerdfonts], which offer a maximum of icons you can use to configure your prompt.
To easily find the icon you want, have a look at their [cheat sheet][nf-cheat].
:::

## Installation

```powershell
Install-Module oh-my-posh -Scope CurrentUser -AllowPrerelease
```

## Usage

### Show all themes

To display every available theme in the current directory, use the following
command.

```powershell
Get-PoshThemes
```

### Set the prompt

Autocompletion is available so it will loop through all available themes.

```powershell
Set-PoshPrompt -Theme jandedobbeleer
```

### Create your own theme

You can output the current theme to its `JSON` representation which can be used to tweak and store as your custom theme.

```powershell
Write-PoshTheme
```

Due to a bug in PowerShell, if you want to use `Out-File` directly to write the current theme to a new file, use the `oem`
encoding to ensure the symbols are outputted correctly.

```powershell
Write-PoshTheme | Out-File -FilePath ~/.mytheme.omp.json -Encoding oem
```

Once you're done editing, adjust your `$PROFILE` to use your newly created theme.

```powershell
Set-PoshPrompt -Theme ~/.mytheme.omp.json
```

[nerdfonts]: https://www.nerdfonts.com/
[nf-cheat]: https://www.nerdfonts.com/cheat-sheet
