468,249 Members | 1,488 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Power Shell: Read file into an array

158 100+
I have a script that gets all the computer names on the network and saves them as compnames.txt. I would like to read or insert all of the names (delineated by new line) into an array or power shell equivalent. How would one go about doing this?

Thanks in advance
Jollywg
Mar 8 '11 #1
1 1949
Jollywg
158 100+
Nevermind I found it

$a = get-content "C:\path\complist.txt"
Mar 8 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

40 posts views Thread by Abby | last post: by
3 posts views Thread by Mark Dunmill | last post: by
2 posts views Thread by somequestion | last post: by
3 posts views Thread by =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post: by
2 posts views Thread by xplode144 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.