Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 13466)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 13467)
@@ -66,4 +66,5 @@
 import java.util.Properties;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -725,5 +726,6 @@
     public static int getPowerShellVersion() {
         try {
-            return Integer.valueOf(Utils.execOutput(Arrays.asList("powershell", "-Command", "$PSVersionTable.PSVersion.Major")));
+            return Integer.valueOf(Utils.execOutput(Arrays.asList(
+                    "powershell", "-Command", "$PSVersionTable.PSVersion.Major"), 2, TimeUnit.SECONDS));
         } catch (NumberFormatException | IOException | ExecutionException | InterruptedException e) {
             Logging.error(e);
@@ -750,5 +752,5 @@
                         "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;"+
                         "[System.Net.WebRequest]::Create('"+uri+"').GetResponse()"
-                        ));
+                        ), 5, TimeUnit.SECONDS);
             } catch (ExecutionException | InterruptedException e) {
                 Logging.error(e);
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13466)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 13467)
@@ -827,5 +827,5 @@
      * Runs an external command and returns the standard output.
      *
-     * The program is expected to execute fast.
+     * The program is expected to execute fast, as this call waits 10 seconds at most.
      *
      * @param command the command with arguments
@@ -836,4 +836,21 @@
      */
     public static String execOutput(List<String> command) throws IOException, ExecutionException, InterruptedException {
+        return execOutput(command, 10, TimeUnit.SECONDS);
+    }
+
+    /**
+     * Runs an external command and returns the standard output. Waits at most the specified time.
+     *
+     * @param command the command with arguments
+     * @param timeout the maximum time to wait
+     * @param unit the time unit of the {@code timeout} argument. Must not be null
+     * @return the output
+     * @throws IOException when there was an error, e.g. command does not exist
+     * @throws ExecutionException when the return code is != 0. The output is can be retrieved in the exception message
+     * @throws InterruptedException if the current thread is {@linkplain Thread#interrupt() interrupted} by another thread while waiting
+     * @since 13467
+     */
+    public static String execOutput(List<String> command, long timeout, TimeUnit unit)
+            throws IOException, ExecutionException, InterruptedException {
         if (Logging.isDebugEnabled()) {
             Logging.debug(join(" ", command));
@@ -852,5 +869,8 @@
             }
             String msg = all != null ? all.toString() : null;
-            if (p.waitFor() != 0) {
+            if (!p.waitFor(timeout, unit)) {
+                throw new ExecutionException(msg, null);
+            }
+            if (p.exitValue() != 0) {
                 throw new ExecutionException(msg, null);
             }
