Search code examples
powershellpsreadlineoh-my-posh

Get-PSReadLineKeyHandler : A parameter cannot be found that matches parameter name 'Key'. What is this in Oh My Posh?


Get-PSReadLineKeyHandler : A parameter cannot be found that matches parameter name 'Key'.
At line:380 char:43
+             if ((Get-PSReadLineKeyHandler -Key Spacebar).Function -eq ...
+                                           ~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-PSReadLineKeyHandler], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.GetKeyHandlerCommand

Get-PSReadLineKeyHandler : A parameter cannot be found that matches parameter name 'Key'.
At line:383 char:43
+             if ((Get-PSReadLineKeyHandler -Key Enter).Function -eq 'O ...
+                                           ~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-PSReadLineKeyHandler], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.GetKeyHandlerCommand

This appears everytime whenever I open my powershell. What can I do to fix this?

Looking for a solution.


Solution

  • You need to update the PSReadLine module. Run:

    Install-Module PsReadLine -Force