oh-my-posh/website/docs/installation/windows.mdx
2022-05-13 08:19:35 +02:00

160 lines
4.3 KiB
Plaintext

---
id: windows
title: Windows
sidebar_label: ⊞ Windows
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
## Set up your terminal
While Oh My Posh works on the standard terminal, we advise using the [Windows Terminal][wt].
:::info
To display all icons, we recommend the use of a [Nerd Font][fonts].
:::
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [linux][linux] installation guide.
:::
## Install
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
]
}>
<TabItem value="winget">
Open a PowerShell prompt and run the following command:
```powershell
winget install oh-my-posh
```
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
```powershell
scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
```
</TabItem>
<TabItem value="manual">
Open a PowerShell prompt and run the following command:
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
```
</TabItem>
</Tabs>
This installs a couple of things:
- `oh-my-posh.exe` - Windows executable
- `themes` - The latest Oh My Posh [themes][themes]
For the `PATH` to be reloaded, a restart of your terminal is advised.
:::warning Antivirus software
Due to frequent updates of Oh My Posh, Antivirus software occasionally flags it (false positive).
To ensure Oh My Posh isn't blocked you can either report it to your favorite Antivirus software as false positive
(e.g. [Report a false positive/negative to Microsoft for analysis][report-false-positive]) or create an exclusion for it.
Exclusions should be added with the full path to the executable, you can get it with the following command from a PowerShell prompt:
```powershell
(Get-Command oh-my-posh).Source
```
:::
## Update
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
]
}>
<TabItem value="winget">
Open a PowerShell prompt and run the following command:
```powershell
winget upgrade oh-my-posh
```
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
```powershell
scoop update oh-my-posh
```
</TabItem>
<TabItem value="manual">
Open a PowerShell prompt and run the following command:
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
```
</TabItem>
</Tabs>
## Default themes
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
]
}>
<TabItem value="winget">
You can find the themes winget installs inside the folder indicated by the environment variable `POSH_THEMES_PATH`.
To use `jandedobbeleer.omp.json` in PowerShell for example, you can refer to it using `$env:POSH_THEMES_PATH\jandedobbeleer.omp.json`
when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="scoop">
You can find the themes scoop installs inside the `"$(scoop prefix oh-my-posh)\themes\"` folder.
To use `jandedobbeleer.omp.json` in PowerShell for example, you can refer to it using `"$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json"`
when setting the prompt using the `--config` flag.
</TabItem>
<TabItem value="manual">
You can find the themes inside the folder indicated by the environment variable `POSH_THEMES_PATH`.
To use `jandedobbeleer.omp.json` in PowerShell for example, you can refer to it using `$env:POSH_THEMES_PATH\jandedobbeleer.omp.json`
when setting the prompt using the `--config` flag.
</TabItem>
</Tabs>
[fonts]: /docs/configuration/fonts
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
[linux]: /docs/installation/linux
[themes]: /docs/themes
[report-false-positive]: https://docs.microsoft.com/en-us/microsoft-365/security/defender/m365d-autoir-report-false-positives-negatives#report-a-false-positivenegative-to-microsoft-for-analysis