Correcting typing errors when using PowerShell

When I type and if I misspell a word the only way I see to correct is to delete back to that error and correct it, then retype everything again from that point on. I just can’t go to the mistake and correct it.
If I hit ENTER then realize a mistake I have to retype the entire thing again. You can’t even go back using delete at this point, once you hit ENTER.
There has got to be a better way to correct errors when using PowerShell.
What am I doing wrong ?

Hi, welcome to the forum :wave:

You can navigate what you’ve typed using the cursor keys (arrow keys).
Once you’ve hit ENTER, use the up arrow to bring up the previously typed command. Use the left and right arrows to position the cursor.

You can find more tips for navigating the console here:

1 Like

And, if you are a VI user, you can add VI editing to your PowerShell

Open your Microsoft.PowerShell_Profile.ps1 from your Documents\WindowsPowerShell folder and add the following:

Set-PSReadlineOption -EditMode 'Vi'

Also Ctrl-LeftArrow and Ctrl-RightArrow will jump word by word. Actually word separator by word separator but you get the idea.