module Mixlib::ShellOut::Windows

def command_to_run(command)

def command_to_run(command)
  return run_under_cmd(command) if should_run_under_cmd?(command)
  candidate = candidate_executable_for_command(command)
  if candidate.length == 0
    raise Mixlib::ShellOut::EmptyWindowsCommand, "could not parse script/executable out of command: `#{command}`"
  end
  # Check if the exe exists directly.  Otherwise, search PATH.
  exe = which(candidate)
  if exe_needs_cmd?(exe)
    run_under_cmd(command)
  else
    [ exe, command ]
  end
end