Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • OP states: "Environment.SetEnvironmentVariable("TEST1","1",EnvironmentTarget.User) is setting REGISTRY keys, which is not appropriate... I dont want these to survive restarts of the cmd shell" Commented Aug 21, 2024 at 15:40
  • I dont want to set permanent environment variables, I just want to export the environment variables into the environment that the current shell is running. Using bash, a script would call "export VARIABLE=value" and that VARIABLE now exists within the bash environment so that whatever is looking for it sees it. CMD scripts ironically default the opposite, always EXPORTING the variables unless SETLOCAL is called first. I need to be able to EXPORT from a C# program but it appears I need to parse the gitverison json some other way. Commented Aug 28, 2024 at 22:25