1

I'm new to PowerShell and installed PSReadline (via PsGet). Now I want to add the sample key binding in my profile file, should I just copy & paste the contents or is it better to load the file? How do I do that?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
IttayD
  • 28,271
  • 28
  • 124
  • 178

1 Answers1

1

I would copy and paste the custom bindings that you want into your profile. The SamplePSReadline.ps1 script is meant to give a whole bunch of examples for folks to figure out how to write their own custom handlers. I would make sure you put the Import-Module command and custom bindings inside the if test that makes sure you're in the ConsoleHost.

if ($host.Name -eq 'ConsoleHost') {
    Import-Module PSReadline
    ...
}
Keith Hill
  • 194,368
  • 42
  • 353
  • 369