WSL bash powershell alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__WINSYS32=/mnt/c/Windows/system32 | |
__POWERSHELL=${__WINSYS32}/WindowsPowerShell/v1.0/powershell.exe | |
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:]]*') | |
fi | |
$__WINSYS32/chcp.com $__OEMCP >/dev/null | |
$__POWERSHELL "$@" | tr -d '\015' | |
$__WINSYS32/chcp.com 65001 >/dev/null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment