private Map findDesktopEditions()

in powershell-agent/src/main/java/jetbrains/buildServer/powershell/agent/detect/registry/RegistryPowerShellDetector.java [47:69]


  private Map<String, PowerShellInfo> findDesktopEditions() {
    Map<String, PowerShellInfo> result = new HashMap<>();
    boolean isV1Installed = isDesktopEditionInstalled("1");
    boolean isV3Installed = isDesktopEditionInstalled("3");
    if (!isV1Installed && !isV3Installed) {
      LOG.debug("PowerShell desktop edition for was not found");
      return result;
    }
    for (PowerShellBitness bitness: PowerShellBitness.values()) {
      PowerShellInfo info = null;
      if (isV3Installed) {
        info = fetchInfoForDesktopEdition(bitness, "3");
      }
      if (info == null) {
        info = fetchInfoForDesktopEdition(bitness, "1");
      }
      if (info != null) {
        logFound(info);
        result.put(info.getHome().getAbsolutePath(), info);
      }
    }
    return result;
  }