Skip to content

Implement a PowerShell cmdlet that returns detailed OS/environment information #419

Closed

Description

VSO create date - 12/22/2015 11:04:00

Activity

  1. andyleejordan commented on Jan 28, 2016

    @andyleejordan
    MemberAuthor

    James Truher (@JamesWTruher) perhaps you could help us figure out how to do this properly. The C# code to determine Linux/Windows/OS X is trivial.

  2. JamesWTruher commented on Jan 29, 2016

    @JamesWTruher
    Collaborator

    sure - I'll be happy to help with that

  3. palladia commented on Feb 4, 2016

    @palladia
    Contributor

    Need more requirements on this cmdlet...

    $os = Get-OperatingSystem
    $os | format-list *
    Name : Linux
    Version : 14.04.1-Ubuntu

    ???

  4. andyleejordan commented on Feb 4, 2016

    @andyleejordan
    MemberAuthor

    That we do. James Truher (@JamesWTruher) how do you think this cmdlet should work?

  5. JamesWTruher commented on Feb 4, 2016

    @JamesWTruher
    Collaborator

    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]
    Sent: Thursday, February 4, 2016 1:12 PM
    To: PowerShell/PowerShell-Linux PowerShell-Linux@noreply.github.com
    Cc: Jim Truher Jim.Truher@microsoft.com
    Subject: Re: [PowerShell-Linux] Implement a PowerShell cmdlet that returns the OS (#419)

    That we do. @JamesWTruherhttps://github.com/JamesWTruher how do you think this cmdlet should work?

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/419#issuecomment-180051628.

  6. 48 remaining items

  7. rjmholt commented on Jun 3, 2019

    @rjmholt
    Collaborator

    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:

    • CIM/WMI isn't available on all platforms (even some Windows ones, due to lockdown) and isn't terribly fast. In cases where a Windows SKU ID is wanted, there are one or two alternatives.
    • The uname syscall is very inconvenient to p/invoke since it requires setting inline C-strings (i.e. char arrays) of platform-dependent size on a struct passed in (StackOverflow question discussing this). On Linux, it's much better to read from /proc/sys/kernel. macOS I haven't explored, but hopefully either (1) there's some other reasonable way to access that information, or (2) the size of struct utsname is more reliable
    • [System.Runtime.InteropServices.RuntimeInformation]::OSDescription might be ok to use on macOS. It's a problem on Linux because it doesn't capture the kernel version fully (if you're on an alternative kernel or patchset, there's no info on that).
    • The /etc/*-release files are also worth capturing on Linux and are readily parseable as CSV/INI. However, they're not well standardised.
      • This man page summarises the os-release concept. It's surprisingly involved.
      • lsb-release is a less formalised standard, but is still widespread. This gist captures variants on many distros
    • Getting the OS architecture may be harder than it looks because, last time I checked, some of System.Runtime.InteropServices.RuntimeInformation's APIs don't work properly on Win 7 kernels (https://github.com/dotnet/corefx/issues/33885).
  8. SteveL-MSFT commented on Jun 5, 2019

    @SteveL-MSFT
    Member

    @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

  9. lukeb1961 commented on Dec 20, 2020

    @lukeb1961

    coming up to its fifth birthday...

  10. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    and removed
    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif
    on Feb 25, 2021
  11. adityapatwardhan commented on Feb 25, 2021

    @adityapatwardhan
    Member

    We recommend that this should be released to the gallery as a separate module.

  12. rkeithhill commented on May 19, 2021

    @rkeithhill
    Collaborator

    FYI, this approach is handy on Linux:

    $osRelease = Get-Content /etc/os-release | ConvertFrom-StringData
    $osRelease
    
    Name                           Value
    ----                           -----
    NAME                           "Ubuntu"
    VERSION                        "18.04.4 LTS (Bionic Beaver)"
    ID                             ubuntu
    ID_LIKE                        debian
    PRETTY_NAME                    "Ubuntu 18.04.4 LTS"
    VERSION_ID                     "18.04"
    HOME_URL                       "https://www.ubuntu.com/"
    SUPPORT_URL                    "https://help.ubuntu.com/"
    BUG_REPORT_URL                 "https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL             "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    VERSION_CODENAME               bionic
    UBUNTU_CODENAME                bionic
    
  13. G31st commented on Jul 8, 2021

    @G31st

    Any traction on this ?

  14. added
    HacktoberfestPotential candidate to participate in Hacktoberfest
    and removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Jul 8, 2021
  15. lukeb1961 commented on Jul 14, 2021

    @lukeb1961

    I see other people have done interesting things in collating this sort of info.
    https://github.com/Jinjinov/Hardware.Info

    GitHub
    Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, motherboard, mouse, NIC - network adapter, printer, sound card - audio card, graphics card - video card. Hardware.Inf...
  16. doctordns commented on Feb 15, 2022

    @doctordns
    Collaborator

    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.

    Ilya (@iSazonov) Steve Lee (@SteveL-MSFT) - can one of you please close this formally?

  17. ghost closed this as completedon Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-ExternalThe issue is caused by external component(s).WG-Cmdletsgeneral cmdlet issuesWG-DevEx-Portabilityauthoring cross-platform or cross-architecture modules, cmdlets, and scripts

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions