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