public PowerShellInfo getVirtualPowerShell()

in powershell-agent/src/main/java/jetbrains/buildServer/powershell/agent/virtual/VirtualPowerShellSupport.java [35:60]


  public PowerShellInfo getVirtualPowerShell(@NotNull final BuildRunnerContext context) {
    final PowerShellEdition edition = PowerShellEdition.fromString(context.getRunnerParameters().get(RUNNER_EDITION));
    String executable = context.getConfigParameters().get(PARAM_EXECUTABLE);
    if (isEmptyOrSpaces(executable)) {
      if (edition == null) {
        executable = EXECUTABLE_VALUE_DEFAULT; // edition is set to auto -> defaulting to CORE
      } else if (edition == PowerShellEdition.CORE) {
        executable = "pwsh";
      } else {
        executable = "powershell.exe";
      }
    } else {
      // executable specified
      context.getBuild().getBuildLogger().logMessage(internalize(createTextMessage(
              "Default PowerShell executable path inside container (" + EXECUTABLE_VALUE_DEFAULT + ") " +
                      "was overridden with " + executable)));
    }
    return new PowerShellInfo(
            PowerShellBitness.x64,
            new File("."),
            "-1",
            null,
            executable,
            true
    );
  }