Power Shell: Read file into an array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    Power Shell: Read file into an array

    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
  • Jollywg
    New Member
    • Mar 2008
    • 158

    #2
    Nevermind I found it

    $a = get-content "C:\path\compli st.txt"

    Comment

    Working...