I have been searching the web on how to modify the /etc/hosts file using powercli
Is it possible to edit files in /etc using powercli?
The reason is I am required to modify all /etc/hosts files and SSL is not a nice solution to managing my 100+ host environment.
Regards
What exactly are you trying to acomplish?
If all you need to do is update the DNS and routing settings then you can use Set-VMHostNetwork
http://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/Set-VMHostNetwork.html
also have you consider a simple WINSCP batch script to copy the master /etc/hosts file to all 100+ hosts?
here is a quick example
http://nixcraft.com/windows-xp-2000-2003-server-administration/18569-winscp-batch-file.html
There are no cmdlets to do this directly I'm afraid.
There is a way by using the Set-VMHostFirmware cmdlet.
See the functions in chapter 12 in the PowerCLI Reference Book. The example is for manipulating the proxy.xml file, but the same principle could be used for other system files.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I ran into the following article regarding this issue; although it's not powershell it sounds as an interesting alternative:
