Problematic UseNewEnvironment switch of Start-Process cmdlet in PowerShell

Have you ever tried using UseNewEnvironment switch when invoking Start-Process cmdlet? Intuitively, turning it on makes the newly created process use the default environment instead of that of the parent process. However, its semantics is way more complicated, obscure and buggy than the intuition. TL; DR: You rarely want to use this switch.

文章来源:

Author:Gee Law’s Blog
link:https://geelaw.blog/entries/ps-start-process-usenewenvironment/?utm_source=feed&utm_medium=rss