Skip to content

Windows platform detection relies on deprecated wmic.exe #675

@clintoncwolfe

Description

@clintoncwolfe

On machines that are missing wmic.exe (such as Windows Nano), inspec detect will be missing architecture data, like this:

Name:      windows_10.0.14393
Families:  windows, os
Release:   10.0.14393
Arch:      unknown

The cause is traced to wmic.exe being missing, which was deprecated. Users are now advised to use powershell commandlets to get the data.

Get-WmiObject Win32_OperatingSystem | Select Version, Caption, BuildNumber | ConvertTo-Json

For getting the CPU architecture, try

Get-CimInstance -Class CIM_Processor -ErrorAction Stop | Select Architecture | ConvertTo-Json

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions