fix: ensure Terminal-Icons and PSReadLine modules are installed before importing in PowerShell profile

This commit is contained in:
Peter Wood
2025-03-19 14:38:50 -04:00
parent 888d3173db
commit a2ddf90a8c

View File

@@ -1,15 +1,23 @@
if (-not (Get-Module -ListAvailable -Name Terminal-Icons)) {
Import-Module -Name Terminal-Icons
}
if (-not (Get-Module -ListAvailable -Name PSReadLine)) {
Import-Module -Name PSReadLine
}
if (-not (Get-Module -ListAvailable -Name tiPS)) {
Install-Module -Name tiPS -Scope CurrentUser
}
if (-not (Get-Module -ListAvailable -Name PSScriptAnalyzer)) {
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
}
if (-not (Get-Module -ListAvailable -Name Terminal-Icons)) {
Install-Module -Name Terminal-Icons -Scope CurrentUser
}
if (-not (Get-Module -ListAvailable -Name PSReadLine)) {
Install-Module -Name PSReadLine -Force -Scope CurrentUser
}
if (-not (Get-Module -ListAvailable -Name Terminal-Icons)) {
Import-Module -Name Terminal-Icons
}
if (-not (Get-Module -ListAvailable -Name PSReadLine)) {
Import-Module -Name PSReadLine
}
# kali.omp.json
oh-my-posh --init --shell pwsh --config "$env:OneDrive\Documents\PowerShell\prompt\themes\easy-term.omp.json" | Invoke-Expression