一,Nerd Font フォントのインストール#
"▯" の文字が表示されないようにするために、Nerd Font フォントをダウンロードしてください。ダウンロード先:https://www.nerdfonts.com/font-downloads
二,PowerShell 用の Oh My Posh のインストール#
1. winget を使用してインストールする#
winget install oh-my-posh
2. Microsoft Store を使用してインストールする#
3. PowerShell テーマを選択して適用する#
notepad $PROFILE
内容を記入する#
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\paradox.omp.json" | Invoke-Expression
テーマの公式ウェブサイト:https://ohmyposh.dev/docs/themes
三,よくある問題#
1. notepad $PROFILE を実行すると、指定されたパスが見つからないというエラーが表示される場合は、Microsoft のドキュメントhttps://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.3 の「Profile types and locations」セクションを参照し、必要なパスを作成して Windows Terminal を再起動してください。
#
2. ファイル ***\WindowsPowerShell\profile.ps1 を読み込むことができません。このシステムではスクリプトの実行が無効になっています。#
現在の実行ポリシーを確認する
>> get-executionpolicy
Restricted
実行ポリシーを変更するには、管理者として PowerShell を開きます
>> set-executionpolicy remotesigned
a または y のオプションを選択し、Windows Terminal を再起動してください。