Reputation: 866
I have a text file containing websites
whatsmyip
stackoverflow
and I want to join each line with .com
at the end of each site. What is the best way to accomplish this?
I set a variable called $sites and on that variable I called the .txt file into the script with get-content
I tried doing a foreach loop to join the two text but my syntax isn't working. Any suggestions?.
foreach ( $website in $site ) {
$website -join ".com"
}
Upvotes: 0
Views: 79