PowerTip: Find Operating System Version and Installation Date with PowerShell


Summary: Use Windows PowerShell to find the operating system version and installation date.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the version of my Windows operating system, its installation date,
           and the operating system architecture?

Hey, Scripting Guy! Answer Use the Get-CimInstance cmdlet (GCIM is an alias) and query the Win32_OperatingSystem WMI class,
           for example:

gcim Win32_OperatingSystem | select Version, InstallDate, OSArchitecture

Comments (3)

  1. Brad_Voris says:

    This for a specific version of PowerShell?
    Get-CimInstance
    The term ‘Get-CimInstance’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
    path is correct and try again.
    At line:1 char:16
    + Get-CimInstance <<<<
    + CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  2. Brian Longworth says:

    Here is a small addition to the script to make it a bit more useful. Rather than showing you the version only, it will now show you the name of the operating system.

    gcim Win32_OperatingSystem | select Caption,Version,OSArchitecture,InstallDate | fl

    (GCIM works in PowerShell 3.0 and higher)

  3. Greg Wojan says:

    It would be really nice if everyone adopted the habit of using:

    [tag:requires] version

    in script fragments just to avoid confusion.

Skip to main content