Skip to content
New issue

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

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

Already on GitHub? # to your account

Windows platform detection relies on deprecated wmic.exe #675

Open
clintoncwolfe opened this issue Mar 31, 2021 · 2 comments
Open

Windows platform detection relies on deprecated wmic.exe #675

clintoncwolfe opened this issue Mar 31, 2021 · 2 comments

Comments

@clintoncwolfe
Copy link
Contributor

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
@tas50
Copy link
Contributor

tas50 commented Mar 31, 2021

What's the impact of this since windows nano is basically a dead platform?

@clintoncwolfe
Copy link
Contributor Author

Looks to be very minor. I just tested again on Windows Server Core LTS 2019, and it does include wmic.exe . Fixing this will be awkward since we don't know if we have Powershell this early in the platform detection phase. I think we should leave it be for now, but if it disappears in the future this issue should be here to track it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants