Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WSL bash powershell alias
powershell() {
if [ -z "${__OEMCP}" ] ; then
__OEMCP=$(${__WINSYS32}/reg.exe query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage" /v OEMCP 2>&1 | sed -n 3p | tr -d '\015' | grep -o '[[:digit:]]*')
$__WINSYS32/ $__OEMCP >/dev/null
$__POWERSHELL "$@" | tr -d '\015'
$__WINSYS32/ 65001 >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment