|
/usr/bin/env sudo $env:SHELL -nologo -Command "& $args" |
Using $env:SHELL only works on systems that have their shell set as Powershell.
How about first checking if the current is pwsh, if not, then check if pwsh-preview exists, if not, then default to pwsh.