Skip to content
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

[sudo] Command is incorrectly parsed when calling a .NET function #42

Closed
brunovieira97 opened this issue Mar 7, 2021 · 0 comments
Closed

Comments

@brunovieira97
Copy link

When calling a .NET function, sudo will incorrectly pass the command to the administrator instance, removing some characters.

Steps to reproduce:

PS> sudo [Environment]::SetEnvironmentVariable('Path', $value, 'Machine')

ParserError:
Line |
   1 |  [Environment]::SetEnvironmentVariable Path, 'C:\Users\bruno\desktop\D …
     |                                        ~~~~
     | Unexpected token 'Path' in expression or statement.

sudo removed the parenthesis, as well as the quotes on Path, causing the command to be syntactically incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant