Add text to every line in text file using PowerShell
- by Joshua
I'd like to add characters to the end of every line of text in a .txt document.
#Define Variables
$a = c:\foobar.txt
$b = get-content $a
#Define Functions
function append-text
{
foreach-Object
{
add "*"
}
}
#Process Code
$b | append-text
Something like that. Essentially, load a given text file, add a "*" the the end of every single line of text in that text file, save and close.