winure/scripts/pwsh.sh

18 lines
322 B
Bash
Executable file

#!/usr/bin/bash
env-share 2> /dev/null
# try to use system-wide version first.
PWSH='/mnt/c/Program Files/PowerShell/7/pwsh.exe'
if [ ! -x "$PWSH" ]; then
unset PWSH
fi
# fall back to System32
if [ -z ${PWSH+x} ]; then
PWSH='/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
fi
# run target
"$PWSH" $@