-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$env
assignment silently runs wrong command
#9599
Comments
Actually I think it's better to wrap the |
mm i dunno. and because the syntax has been relaxed in that area, i think this behaviour above is a bug and a pretty nasty one 🤔 |
i mean if we allow writing things like |
This is basically #9698 rearing its head by returning nothing. |
Closing in favor of #12956 as we collected more cases there. |
Describe the bug
related to #9589
i was playing with variable assignment with the new #9589 feature and i think i noticed a pretty bad silent bug 🤔
the error is a bit unhelpful but it's easily fixed by adding parentheses:
$env.foo = (ls | where type == file)
$env.FOO
being equal to the"ls"
string, without any errorls
How to reproduce
export-env { $env.FOO = ls | where type == file }; $env.FOO
ls
Expected behavior
i expected
export-env { $env.FOO = ls | where type == file }
to either$env.FOO = ls | where type == file
doesls | where type == file
inside$env.FOO
Screenshots
No response
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: