-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Implement a PowerShell cmdlet that returns detailed OS/environment information #419
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
Comments
@JamesWTruher perhaps you could help us figure out how to do this properly. The C# code to determine Linux/Windows/OS X is trivial. |
sure - I'll be happy to help with that |
Need more requirements on this cmdlet... $os = Get-OperatingSystem ??? |
That we do. @JamesWTruher how do you think this cmdlet should work? |
Since I doubt that wmi/cim is not available, it should probably reflect uname output (except as an object) j From: Andy Schwartzmeyer [mailto:notifications@github.com] That we do. @JamesWTruherhttps://github.com/JamesWTruher how do you think this cmdlet should work? — |
I could have swore we wrote a p/invoke that calls uname in C. It should be in monad-native |
FWIW, > [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
Darwin 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64
> uname -a
Darwin marvin 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64 |
Sigh, anything that returns a string is unfortunate. We should try to find out how that string is Created and use the data rather than the result Sent from Outlook Mobilehttps://aka.ms/qtex0l From: Andy Schwartzmeyer <notifications@github.commailto:notifications@github.com> FWIW, [System.Runtime.InteropServices.RuntimeInformation]::OSDescription on my MacBook returns a string very similar to uname -a.
Reply to this email directly or view it on GitHubhttps://github.com//issues/419#issuecomment-186897474. |
Agreed. I wish their interface was better. I'm trying to play around with what's available so I can do a simple switch on the current OS. We should probably open an issue with .NET to get a better interface. |
We should just look at the implementation, and see if we can use it Sent from Outlook Mobilehttps://aka.ms/qtex0l On Sun, Feb 21, 2016 at 12:21 PM -0800, "Andy Schwartzmeyer" <notifications@github.commailto:notifications@github.com> wrote: Agreed. I wish their interface was better. I'm trying to play around with what's available so I can do a simple switch on the current OS. We should probably open an issue with .NET to get a better interface. Reply to this email directly or view it on GitHubhttps://github.com//issues/419#issuecomment-186906437. |
#623 added basic support for this. Further implementation/refinement should be done in the Platform module. |
Changed the title to reflect that this issue addresses more detailed OS/environment info (a la I would say that #1635 is not a dupe, but rather a slightly different ask to add the very basic OS info as a property to |
Some comment about uname A brief summary:
Thus, the command may return unpredictable results depending on the platform and linux distrib. So questions: Would it be a good start to pay attention to Update: Currently CoreFX parse a kernel's |
Probably a big undertaking, but we should probably modify get-computerinfo to not rely on WMI and use .Net api's where possible to have it portable. CC @jeffbi |
I also wonder what the delta is between this and bringing |
Currently, Get-ComputerInfo pulls three items from the Registry and uses five PInvoked native functions. Pretty much everything else comes from WMI. |
Is this still up for grabs? What about a cmdlet that returns properties similar to Ansible's setup module - https://github.com/ansible/ansible-modules-core/blob/devel/windows/setup.ps1 . This is the Windows source but a same named module exists for Linux that returns similar properties if possible. I'm not sure what's possible on Mac except it's like unix in some areas. |
@paulbailey1979 Feel free to grab this. Now we is on .Net Core 3.0 and we should review that it exposes useful for us. |
Just came across this issue. I've done some work close to this in the PSScriptAnalyzer repo, here, where we collect platform information. A few points:
|
@paulbailey1979 if you want to tackle this, I would suggest starting with a RFC detailing what info will be collected (and how) as I'm sure there will be some debate on what information is most critical to collect |
coming up to its fifth birthday... |
We recommend that this should be released to the gallery as a separate module. |
FYI, this approach is handy on Linux:
|
Any traction on this ? |
I see other people have done interesting things in collating this sort of info.
|
The CMDLETS Working Group has reviewed this issue and feels that this is a great candidate for a community module held on the PowerShell Gallery. As such, we are closing this issue as Will Not Implement. There are some published modules and scripts that already met this requirement. We urge the original poster and others to collaborate on a community module if the existing scripts/modules are not satisfactory. If there is adequate interest in such a cmdlet, the working group can review this decision. @iSazonov @SteveL-MSFT - can one of you please close this formally? |
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes. |
VSO create date - 12/22/2015 11:04:00
The text was updated successfully, but these errors were encountered: