public List getPaths()

in powershell-agent/src/main/java/jetbrains/buildServer/powershell/agent/detect/cmd/DetectionPaths.java [50:81]


  public List<String> getPaths() {
    // add predefined paths
    final List<String> propertyPaths = getPredefinedPaths();
    if (LOG.isDebugEnabled()) {
      if (!propertyPaths.isEmpty()) {
        LOG.debug("Adding PowerShell detection paths from [teamcity.powershell.detector.search.paths] property.");
        LOG.debug(StringUtil.join(propertyPaths, "\n"));
      }
    }
    final List<String> result = new ArrayList<>(getPaths(propertyPaths));
    if (SystemInfo.isWindows) {
      result.addAll(getPaths(WINDOWS_PATHS));
    } else {
      // typical *nix locations
      result.addAll(PATHS);
      // add roots, recommended by documentation
      ADDITIONAL_ROOTS.stream()
              .map(File::new)
              .filter(File::isDirectory)
              .forEach(dir -> {
                result.add(dir.getAbsolutePath());
                result.addAll(populateWithChildren(dir));
              });
      // additionally, check $HOME/powershell location
      File homePath = new File(System.getenv("HOME"), "powershell");
      if (homePath.isDirectory()) {
        result.add(homePath.getAbsolutePath());
      }
    }
    addGlobalToolsPath(result);
    return result;
  }