protected final Map getEnv()

in powershell-agent/src/main/java/jetbrains/buildServer/powershell/agent/service/PowerShellServiceWindows.java [89:106]


  protected final Map<String, String> getEnv(@NotNull PowerShellInfo info) {
    Map<String, String> map = getEnvironmentVariables();
    // check internal property
    // supported only by powershell of version > 1 ('==' is therefore used)
    if (!isInternalPropertySetExecutionPolicy("set.executionPolicyEnv", info.getVersion().equals("1.0"))) return map;

    final String env = "PSExecutionPolicyPreference";

    //check if user had overridden the value
    if (map.containsKey(env)) {
      LOG.info(env + " environment variable was specified explicitly");
      return map;
    }

    map = new TreeMap<>(getEnvironmentVariables());
    map.put(env, "ByPass");
    return map;
  }