Not sure what Conditional(string condition) does, but you can get environment variables using Environment.ExpandEnvironmentVariables .
If you are talking about a conditional attribute, you're out of luck. This attribute is evaluated at COMPILE TIME, on your development machine (or on the build server). This does not affect RUNTIME, where you would like to do something different depending on the state of the user machine (as indicated by the environment variable).
You can use the previously mentioned method of the Environment class to determine whether the execution should continue inside the method body. This is probably your best bet.
Will
source share