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','1.2.3.4')
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','1.2.3.4' | % { .\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','1.2.3.4' | % { $_ >> .\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! 😀