Can’t hold shift and type space with Fall 2018 Win10 update

Some people may have run into an annoyance when typing out shorthand pipes to Select-Object or Where-Object.

With the Windows 10 Fall 2018 update, people have noticed an odd issue with PowerShell.  It doesn’t happen with the cmd.exe though, while holding down the left-shift key and typing out a command, spaces are not written.

In both cases in the screenshots below, if you hold the left shift key and typed out “this is a string typed while holding shift.”

Now you might not think this is a big deal, but it causes really annoying formatting when typing out shorthand Where-Object code, i.e.:

For the whole section of “| ? { $_” it’s all symbols which require you to hold the left-shift key, which some people hold down the shift key the entire time they are typing.

This has been identified as an issue in PSReadline. See discussion here: https://github.com/Microsoft/console/issues/282

The workaround you can add to your PS profile:

# Work around an RS5/PSReadline-2.0.0+beta2 bug (Spacebar is not marked 'essential')
Set-PSReadlineKeyHandler "Shift+SpaceBar" -ScriptBlock { [Microsoft.Powershell.PSConsoleReadLine]::Insert(' ')
}