I am looking to grab the file host info from 5 machines Blue,Green,Yellow,White,Red all names stored in a file C:\servers.csv. How can i get the output saved somewhere else. So far this is what I have come up with. Am a newbie
Out-File : Could not find a part of the path 'C:\result\Red_hosts-file.txt'.
At C:\Users\user1\Documents\scripts\hostsfile.ps1:6 char:9
+ Out-File -FilePath "C:\result\$($ComputerName)_hosts-file.txt ...
Neither ran fine. I like the invoke-command but I was thinking a For where…condition …would catch the hosts file for each of the computers then output it.