public List provideCommandLine()

in powershell-agent/src/main/java/jetbrains/buildServer/powershell/agent/PowerShellCommandLineProvider.java [33:56]


  public List<String> provideCommandLine(@NotNull final PowerShellInfo info,
                                         @NotNull final Map<String, String> runnerParams,
                                         @NotNull final File scriptFile,
                                         final boolean useExecutionPolicy,
                                         @NotNull final Map<String, String> sharedConfigParams) throws RunBuildException {
    final List<String> result = new ArrayList<>();
    final PowerShellExecutionMode mod = PowerShellExecutionMode.fromString(runnerParams.get(RUNNER_EXECUTION_MODE));
    if (mod == null) {
      throw new RunBuildException("'" + RUNNER_EXECUTION_MODE + "' runner parameter is not defined");
    }
    addVersion(result, runnerParams, info); // version must be the 1st arg after executable path
    if (!StringUtil.isEmptyOrSpaces(runnerParams.get(RUNNER_NO_PROFILE))) {
      result.add("-NoProfile");
    }
    result.add("-NonInteractive");

    addCustomArguments(result, runnerParams, sharedConfigParams, RUNNER_CUSTOM_ARGUMENTS);
    if (useExecutionPolicy) {
      addExecutionPolicyPreference(result);
    }

    addScriptBody(result, mod, scriptFile, runnerParams, sharedConfigParams);
    return result;
  }