Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

parse strings

$
0
0

I've done a few google searches but would like some help on the following.   I need to read a .TXT file of computer names.   And then I need to grab just the first 3 characters of each computer name.  

 

So I have

$machine = get-content "c:\temp\machines.txt"

Foreach ($line in $machine) {

 

but from here I'm not sure how to get the first 3 characters.   

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles