oh-my-posh/website/docs/installation/windows.mdx

144 lines
3.6 KiB
Plaintext
Raw Normal View History

2021-04-24 03:58:23 -07:00
---
id: windows
title: Windows
2021-04-29 12:17:24 -07:00
sidebar_label: ⊞ Windows
2021-04-24 03:58:23 -07:00
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
2022-08-14 10:58:54 -07:00
import Next from "./next.mdx";
2021-04-24 03:58:23 -07:00
## Set up your terminal
2021-04-24 03:58:23 -07:00
While Oh My Posh works on the standard terminal, we advise using the [Windows Terminal][wt].
2021-04-24 03:58:23 -07:00
:::info
To display all icons, we recommend the use of a [Nerd Font][fonts].
:::
2022-03-09 02:39:31 -08:00
:::caution
When using oh-my-posh inside the WSL, make sure to follow the [Linux][linux] installation guide.
2022-03-09 02:39:31 -08:00
:::
2022-06-02 02:28:56 -07:00
<a href="pathname://ms-windows-store://pdp/?productid=XP8K0HKJFRXGCK" target="_blank">
<img
src={require('/img/winstore.png').default}
alt="Windows Store Link"
className="winstore"
/>
</a>
2022-08-14 10:58:54 -07:00
## Installation
2021-04-24 03:58:23 -07:00
2021-01-29 10:50:11 -08:00
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
2021-01-29 10:50:11 -08:00
]
}>
<TabItem value="winget">
Open a PowerShell prompt and run the following command:
2021-01-29 10:50:11 -08:00
```powershell
winget install JanDeDobbeleer.OhMyPosh -s winget
2021-01-29 10:50:11 -08:00
```
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
2021-04-24 03:58:23 -07:00
```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>
2021-09-08 10:19:58 -07:00
This installs a couple of things:
- `oh-my-posh.exe` - Windows executable
- `themes` - The latest Oh My Posh [themes][themes]
2021-01-29 10:50:11 -08:00
For the `PATH` to be reloaded, a restart of your terminal is advised.
2021-01-29 10:50:11 -08:00
:::tip 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
```
:::
2022-08-14 10:58:54 -07:00
<Next />
## Update
2021-04-24 03:58:23 -07:00
2021-01-29 10:50:11 -08:00
<Tabs
defaultValue="winget"
groupId="install"
values={[
{ label: 'winget', value: 'winget', },
{ label: 'scoop', value: 'scoop', },
{ label: 'manual', value: 'manual', },
2021-01-29 10:50:11 -08:00
]
}>
<TabItem value="winget">
Open a PowerShell prompt and run the following command:
2021-04-24 03:58:23 -07:00
```powershell
winget upgrade JanDeDobbeleer.OhMyPosh -s winget
2021-04-24 03:58:23 -07:00
```
2021-01-29 10:50:11 -08:00
</TabItem>
<TabItem value="scoop">
Open a PowerShell prompt and run the following command:
2021-01-29 10:50:11 -08:00
```powershell
scoop update oh-my-posh
2021-01-29 10:50:11 -08:00
```
</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'))
```
2021-01-29 10:50:11 -08:00
</TabItem>
</Tabs>
2022-03-09 02:39:31 -08:00
## Default themes
2021-04-24 03:58:23 -07:00
You can find the themes in the folder indicated by the environment variable `POSH_THEMES_PATH`.
For example, you can use `oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json"`
for the prompt initialization in PowerShell.
2021-04-24 03:58:23 -07:00
2021-01-29 10:50:11 -08:00
2022-06-03 07:47:56 -07:00
[fonts]: /docs/installation/fonts
2021-04-24 03:58:23 -07:00
[scoop]: https://scoop.sh/
[wt]: https://github.com/microsoft/terminal
2022-04-21 23:00:05 -07:00
[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