| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| { | ||
| #if !UNIX | ||
| var winPSVersionString = Utils.GetWindowsPowerShellVersionFromRegistry(); | ||
| if (!winPSVersionString.StartsWith("5.1", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
In CreateRunspacesForUseWindowsPowerShellParameterSet() we request connectionInfo.PSVersion = new Version(5, 1)
This is not enough?
Sorry, something went wrong.
There was a problem hiding this comment.
Unfortunately, not enough. Error is generated too late - when remote WinPS process is already starting and parsing arguments and Job's code (that we are reusing in WinCompat and that starts remote process) not doing a great job at reporting it, so user experience is not good - user gets an impression that everything is fine, when in fact WinCompat is not working.
Also, detecting the incompatible environment and reporting a clear error sooner than later is better performance-wise.
Sorry, something went wrong.
There was a problem hiding this comment.
I guess most of user systems already have PS 5.1 so version check is an edge case.
I guess PowerShell processes Version parameter before other parameters so it doesn't extra work.
Also I think it is useful to catch Windows PowerShell exit code and write an error if needed - do we this? In PR case we could catch -1 exit code, catch message "Cannot start Windows PowerShell. No version of Windows PowerShell compatible to 5.1 is installed." and then write appropriate error to user.
Sorry, something went wrong.
There was a problem hiding this comment.
You are right, theoretically on the high level that's probably the right approach. The devil is in details, special-casing WinCompat needs small changes in remoting code and it is already complex-enough. Just for the risk of regressions in high-use features (remoting, jobs) I would like to avoid doing changes in remoting code unless absolutely necessary.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Andrew, is this needed for 7.0... please change the milestone on any PR's that are to rc.1-consider. |
Sorry, something went wrong.
|
Codacy failure seems to be false positive because it does not correctly handle code branches based on preprocessor directives. |
Sorry, something went wrong.
|
Andrew (@anmenaga) can you respond to comments from Ilya |
Sorry, something went wrong.
|
🎉v7.0.0-rc.1 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
WinCompat functionality needs Windows PS 5.1
This change modifies Import-Module so that WinCompat returns an error if Windows PS on the current system is not 5.1 (with recommendation to install WMF).
PR Checklist