winure/scripts/pwsh.sh

19 lines
322 B
Bash
Raw Normal View History

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