Fix CommandNotFound check OS

This commit is contained in:
Fabio Scotto di Santolo
2025-01-02 19:50:02 +01:00
parent e27790595a
commit 0c4d4de041

View File

@@ -296,7 +296,14 @@ if (Get-Command zoxide -ErrorAction SilentlyContinue) {
Set-Alias -Name z -Value __zoxide_z -Option AllScope -Scope Global -Force Set-Alias -Name z -Value __zoxide_z -Option AllScope -Scope Global -Force
Set-Alias -Name zi -Value __zoxide_zi -Option AllScope -Scope Global -Force Set-Alias -Name zi -Value __zoxide_zi -Option AllScope -Scope Global -Force
#Import-Module -Name Microsoft.WinGet.CommandNotFound $isWin = $PSVersionTable.OS -match "Windows"
if (-not (Get-Module -ListAvailable -Name Microsoft.WinGet.CommandNotFound) -and $isWin) {
Install-Module -Name Microsoft.WinGet.CommandNotFound -Scope CurrentUser -Force -SkipPublisherCheck
}
if ($isWin) {
Import-Module -Name Microsoft.WinGet.CommandNotFound
}
# Import Modules and External Profiles # Import Modules and External Profiles
# Ensure Terminal-Icons module is installed before importing # Ensure Terminal-Icons module is installed before importing