| When the WinRM transport is used with the run_command method, Bolt leverages the WinRM gem and deliberately chooses to create a PowerShell session on the remote host. Using the local_windows transport to execute commands on the local host however is different. A simple call to Open3.capture3 is made. The effect on the end user is that the behavior of commands given to run_command is inconsistent. Litmus for instance exposes a method called `run_shell` that ends up leveraging `run_command`. Users that want to test their module using Litmus would be forced to detect within their test suite which scenario they are in at run time, local or remote, and if local, wrap their own commands in `powershell.exe -noprofile -command # {blah} ` boilerplate on their own. Instead, since the better default choice has already been made for WinRM transport commands, it seems like it could solve the issue closer to the source if the local transport were made to implement it's own wrapper, so that all consumers of the `run_command` method in Bolt spec, whether they be end users or frameworks, could enjoy consistency in the behavior of their commands. As an example of users already affected see this PR comment in which we are already faced with this difficulty while converting a module's test suite to Litmus. |