chef / knife-windows

Plugin for Chef's knife tool for working with Windows nodes
Apache License 2.0
152 stars 110 forks source link

knife winrm chef-client version prints workstation version #436

Closed martinmosegaard closed 6 years ago

martinmosegaard commented 6 years ago

If I want to see the chef-client version of a node, I try to run something like this:

λ knife winrm name:my-awesome-node -x administrator -P supersecret chef-client --version
Chef: 12.18.31

But instead it prints the version of chef-client on the workstation where I am executing knife. So it matches this:

λ where chef-client
C:\opscode\chefdk\bin\chef-client
C:\opscode\chefdk\bin\chef-client.bat

λ chef-client --version
Chef: 12.18.31

The chef-client version on the remote machine in this case was 12.21.10

mwrock commented 6 years ago

I think you want to quote chef-client --version otherwise --version gets pased as an arg of knife winrm

martinmosegaard commented 6 years ago

Thanks for helping out @mwrock, you are right . I see some of the commands in the README are quoted too. Could we enhance knife winrm --version to also print the version of knife-windows? As a more convenient way than doing chef gem list knife-windows.