Skip to content

Commit

Permalink
Fix PowerShell hang when checking dll version (#29)
Browse files Browse the repository at this point in the history
Fixes #27

When the dll version check hung, `LSP-PowerShellEditorServices` could not determine 
the version and tried to download and install `PowerShellEditorServices` again.

As a side effect, LSP server startup is faster.
  • Loading branch information
Paciupa authored Nov 21, 2024
1 parent 05fd110 commit c7fe4fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def needs_update_or_installation(cls) -> bool:
# Install only, if powershell is available!
return False
cmd = '[System.Diagnostics.FileVersionInfo]::GetVersionInfo("{}").FileVersion'.format(cls.dll_path())
version_info = cls.run(powershell_exe, "-Command", cmd).decode('ascii')
version_info = cls.run(powershell_exe, "-NoLogo", "-NoProfile", "-Command", cmd).decode('ascii')
version_info = ".".join(version_info.splitlines()[0].strip().split('.')[0:3])
return cls.version_str() != version_info
except Exception:
Expand Down

0 comments on commit c7fe4fb

Please sign in to comment.