I would like to ask you pretty easy question about foreach and output,
I noticed that while we are trying to run foreach and then export it by out-file it is more complicated, my question is what is the right way to export the content with foreach ?
For instance I prepare this:
Get-Content C:\Windows.old\1.txt
$output =
Foreach ($line in $file)
{
$line + " "+ $line.Length + " is the lengh of you user name"
}
And I know that is incorrect, I am looking for good explanation