Prerequisites
Steps to reproduce
See also:
The expansion of an unquoted, literal, standalone ~ or of an unquoted, literal, ~/ prefix to the value of $HOME / "$HOME/" when calling native (external) programs is meant to emulate the tilde shell expansion feature in POSIX-compatible shells such as Bash.
In such shells tilde expansion is NOT performed when a path argument is provided via a variable.
PowerShell should exhibit the same behavior, but currently performs expansion nonetheless (unless the variable reference itself happens to be "..."-enclosed):
# Bash behavior, for contrast:
# ~ is NOT expanded.
bash -c 'p="~"; echo $p'
# !! PowerShell DOES expand
$p = '~'
/bin/echo $p
Expected behavior
Actual behavior
Error details
No response
Environment data
PowerShell 7.5.0-preview.2
Visuals
No response