2
1
In Windows 10, Shift-right-clicking on a folder or in the background in File Explorer adds an "OpenPowerShell window here" command to the context menu.
However, the command used to open the PowerShell window is ill-defined (as of at least W10 release ID 1709) in that it incorrectly assumes that folder names never contain embedded '
characters:
# !! Breaks with folder names such as "a'b"
powershell.exe -noexit -command Set-Location -literalPath '%V'
See below for a fix, but note that it requires administrative privileges.