Question Locked

Powershell > Variables from Text File

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi guys

Was wondering if anyone knew how to have an external .txt file in which i have a list of server IPs.
These need to be read by my powershell skript and each individual one turned into a variable.

I am making a loop, and everytime my script starts the loop again i want it to take the next line in the corresponding text file...
Any ideas???

Thanks in advance!!

Max

2 replies

by tony hopkinson

Write a script that takes the IP as a parameter and does it's stuff.

Write another that reads each line from teh file and calles teh above with the content.

This discussion is closed to new replies.