You can use this PowerShell script to update a HOSTS file remotely. This procedure can be used to modify any files remotely.
Input File: Servers.csv – This file contains server name or IP address.
Output – You will see the status update on the screen as displayed in the following screenshot:
Download – This script can be downloaded from the following locations: