I regularly use the the echo $PWD > /dev/clipboard
in Git Bash to hardcode paths in my scripts but I find it quite annoying to have to run Git Bash to do this, I would really like to do that in powershell
The issue it that it seems that the output of echo $PWD
(or really any environnement variables) makes weird thing with the clipboard
echo $pwd
outputs
Path
----
C:\ProgramData\chocolatey\bin
And if I try to put it in clipboard using echo $pwd | Set-Clipboard
it just fails silently, it tries to add it but Windows straight up refuses (Office Clipboard says that it's an unsupported fornat, although it's just text)
Set-Clipboard -Value $pwd
Works but prepends the path with this annoying Path ----
Is there any way to have just the path like %cd%
works in CMD but in Powershell?