Skip to content →

Node list as a CLI option. Why not?

If you have ever tried NMTools you may wonder why there is not an CLI option to allow something like this:

PS C:\> C:\.\nmagent.ps1 -profile main -cmd exec -src hlist @('host1','host2','')

The answer is that it is planned but it is not a priority. Why? Because you can get similar results on the mean time using the following work around:

PS C:\> 'host1','host2','' | % { .\nmagent.ps1 -profile main -cmd exec -src host $_ }

Unfortunately, both sentences are not exactly the same. The first one would run the whole nodes on the same SessionId. The second one, on the other hand, would have a different SessionId for each node. If you need them to be in the same SessionId, you can try the following two-step approach:

PS C:\> 'host1','host2','' | % { $_ >> .\MyTempFile.txt }
PS C:\> .\nmagent.ps1 -profile main -cmd exec -src file .\MyTempFile.txt

As Jeffrey Snover says, “to ship, is to choose”. In any case, that feature will be there: just stay tuned! 😀


Creative Commons License
Except where otherwise noted, ThinkInBig by Carlos Veira Lorenzo is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Published in Automation Projects System Management