- The
executor
in the code is aCommandExecutor
which sets up and reuses a remote shell session across calls and recyles it before the maxiumum commands-per-shell limit is reached. - The
vanilla
object is a regularWinRM::WinRMWebService
instance which sets up and tears down a shell for every CMD and Powershell script invocation. - The Powershell script variant is really running a
powershell -encodedCommand <ENCODED_SCRIPT>
over CMD. - The file appending operation isn't very taxing on the Windows host but simulates a chunked file upload and so tries to measure the relative cost of command invocations vs. measuring the time for the commands to execute.
- A 2x speed up is great for CMD commands!
- Any speed gains in invoking Powershell scripts is wiped out by the setup/teardown cost
- A 100x cost penalty for running Powershell scripts is enough to give the author pause