diff --git a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 index c76ad80..0390a89 100644 --- a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 +++ b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 @@ -87,7 +87,7 @@ Remove-Variable -Name nvim $OutputEncoding = [System.Text.Encoding]::UTF8 # Try upgrading the default version of PSReadLine to something newer. -if ((Get-Module PSReadline).Version -le [Version]"2.0.0.0") { +if ($null -ne (Get-Module PSReadline).Version -and (Get-Module PSReadline).Version -le [Version]"2.0.0.0") { try { Write-Host "PSReadLine <= 2.0.0.0. Trying to upgrade..." Install-Module -Scope CurrentUser -Name PSReadLine -Force -ErrorAction SilentlyContinue