Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Read txt file using powershell to feed a command

Avatar of John Darby
John DarbyFlag for United States of America asked on
Microsoft Legacy OSMicrosoft DevelopmentPowershell
3 Comments1 Solution711 ViewsLast Modified:

I have a command I want to feed a variable from a txt file. The command is...

kerblist get ldap/$variablename

The textfile is named  .\sitedcs.txt

The txt file will have 3-8 entries which are hostnames for the local site DCs.

I remember the FOR loop from the CMD shell days, but am sure there is a better way within native PS.

Avatar of Adam Brown
Adam BrownFlag of United States of America imageCloud Security Consultant
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers