Hi,

the following code:

Code:
Console.WriteLine(Environment.UserInteractive.ToString());
Seems to ALWAYS return true, such as compiled into a Console application, and when executed from a BAT file and ps1 also.

Code:
PS C:\temp> .\EnvironmentTest.ps1 -NonInteractive

C:\temp>.\EnvironmentTest.exe
True
PS C:\temp>
I had hoped the
Code:
-NonInteractive
parameter would do the trick. However it does not force it to false.

Is there any way to trick this System.Environment variable that is already compiled into an .exe?

Thanks!

Dave