- Timestamp:
- 2018-02-26T01:10:01+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r13463 r13465 717 717 718 718 /** 719 * Returns the major version number of PowerShell. 720 * @return the major version number of PowerShell. -1 in case of error 721 * @since 13465 722 */ 723 public static int getPowerShellVersion() { 724 try { 725 return Integer.valueOf(Utils.execOutput(Arrays.asList("powershell", "-Command", "$PSVersionTable.PSVersion.Major"))); 726 } catch (NumberFormatException | IOException | ExecutionException | InterruptedException e) { 727 Logging.error(e); 728 return -1; 729 } 730 } 731 732 /** 719 733 * Performs a web request using Windows CryptoAPI (through PowerShell). 720 734 * This is useful to ensure Windows trust store will contain a specific root CA. … … 728 742 // Invoke-WebRequest -SSlProtocol Tsl12 $uri 729 743 // .NET framework < 4.5 does not support TLS 1.2 (https://stackoverflow.com/a/43240673/2257172) 730 if (isDotNet45Installed() ) {744 if (isDotNet45Installed() && getPowerShellVersion() >= 3) { 731 745 try { 732 746 // The following works with PS 3.0 (Windows 8+), https://stackoverflow.com/a/41618979/2257172
Note:
See TracChangeset
for help on using the changeset viewer.