Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete rewrite of windows version detection #70

Merged
merged 4 commits into from
Feb 19, 2016

Conversation

chris-rock
Copy link
Contributor

The new Windows version detection is not based on Powershell anymore, it uses two core commands:

  • ver is a command-line tool since MSDOS that outputs the version of the Operating System
  • systeminfo was introduced in Windows XP Professional and outputs more system details
  • wmic os get * /format:list to retrieve the details of the operating system

Unfortunately we cannot rely on ver only, since build numbers and version are sometimes the same between Windows Client and Server. Therefore we cannot use this alone to distinguish between both operating systems.

@mwrock
Copy link
Contributor

mwrock commented Feb 14, 2016

Might consider run_wql see https://github.com/WinRb/WinRM/blob/master/lib/winrm/command_executor.rb#L171

And querying win32_operatingsystem

@mwrock
Copy link
Contributor

mwrock commented Feb 14, 2016

Then you may just need one call

@chris-rock
Copy link
Contributor Author

@mwrock Great Idea. Is that working on CLI as well? We do not have WinRM available all the time. I try to find a solution that is very minimal and works remote and locally. It should have no specific dependency on PowerShell or any scripting.

@mwrock
Copy link
Contributor

mwrock commented Feb 15, 2016

Oh I thought this was all remote. Wmic would be the cli equivalent

@chris-rock
Copy link
Contributor Author

Thanks @mwrock for this great idea. wmic was a lifesaver and made the implementation much easier. Since the current implementation does not depend on Powershell anymore, it is much more stable and works awesome remote and locally.

@arlimus
Copy link
Contributor

arlimus commented Feb 19, 2016

Awesome improvement, and much simpler this way. Love the tests too @chris-rock 👍
Cheers @mwrock for your help :)

arlimus added a commit that referenced this pull request Feb 19, 2016
complete rewrite of windows version detection
@arlimus arlimus merged commit ea935cc into master Feb 19, 2016
@arlimus arlimus deleted the chris-rock/win-detection branch February 19, 2016 13:23
@mwrock
Copy link
Contributor

mwrock commented Feb 19, 2016

@clintoncwolfe clintoncwolfe added Type: Bug Feature not working as expected and removed breaking-change labels Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants