Iam trying to input a list of machines to a foreach loop and the loop should process only one machine at a time.
Consider the below loop. Say the variable $machinenames has the Values:-
ComputerA
ComputerB
ComputerC
ComputerD
Here it appears like the $test is getting the entire list instead of each machine at a time.. Is there a de-limiter which we can specify some where or some one please suggest me a better way?
------------------------------------------------------------------------
$machinenames =Get-content "C:\Testfile.txt"
Foreach ($test in $machinenames)
{# do a task}
----------------------------------------------------====
Justin Abraham ----------------------------- Knowledge is Power