在windows上的powershell上配置oh-my-posh,使其更像在linux用oh-my-zsh。
- 首先打开
powershell,输入: 
winget install JanDeDobbeleer.OhMyPosh -s winget
 
安装on-my-posh.exe和oh-my-posh上最新的主题。
之后重启powershell。
- 打开配置文件
 
# 如果之前没有配置文件,就新建一个 PowerShell 配置文件
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
# 用记事本打开配置文件
notepad $PROFILE
 
Import-Module posh-git 
Import-Module oh-my-posh
# 设置主题为Agnoster
Set-PoshPrompt Agnoster
 
之后重启即可。

由于windows缺少一些支持的字体,所以看见的是乱码的情况。
在Nerd Fonts - Iconic font aggregator, glyphs/icons collection, & fonts patcher上找字体进行下载。
推荐使用Meslo Nerd Font,


下载完成进行解压后,打开目录:全选进行字体安装

在终端默认值中进行设置:

之后就配置好了。

在vscode终端中配置,打开setting.json,进行设置
    "terminal.integrated.fontFamily": "MesloLGM Nerd Font",
 


待解决
windows10默认的powershell字体选项中没有Meslo Nerd Font,仍然乱码。

5 个 PowerShell 主题,让你的 Windows 终端更好看 - 少数派 (sspai.com)
Windows Terminal 快速配置 oh-my-posh_windows 设备oh-my-posh字体-CSDN博客
Fonts | Oh My Posh



















