Q: What's the proper way to run inspec under Windows?

NOTICE: Moved from GitHub: https://github.com/inspec/inspec/issues/3936

:control_knobs: Description

question: what's the proper way to run inspec under Windows?
I'm getting the error at the Stacktrace section when I'm running inspec from powershell.

:earth_africa: InSpec and Platform Version

inspec --version
3.9.0

Windows 10

:thinking: Replication Case

run inspec from a powershell terminal

:computer: Stacktrace

inspec : Cannot process the XML from the 'Error' stream of 'c:\opscode\inspec\bin\inspec.bat': Root element is missing.
At C:\jenkins\workspace\windows\3_test.ps1:18 char:1

  • inspec exec .\tests\uninstall.rb --reporter cli junit:artifacts/test_ ...
  •   + CategoryInfo          : SyntaxError: (c:\opscode\inspec\bin\inspec.bat:String) [], XmlException
      + FullyQualifiedErrorId : ProcessStreamReader_CliXmlError

We'd need more information from the user, there's nothing fundamentally faulty with running inspec exec . --reporter cli junit:out.xml on Windows.

  • Does updating ChefDK (it looks like this is ChefDK InSpec rather than a gem) help?
  • Does the command work when run directly (and not part of the Jenkins script mentioned in the issue)?

The error looks maybe like some unhandled error is happening and InSpec isn't getting far enough to output XML?