Hi all, i'm trying to write a Ps script that read a file and give me as result only some lines of this filtering the whole file.
I'm trying to do this with this code:
$testo = Get-Content C:\myfile.txt | where {$_ -Like "*word*"}
ForEach-Object {$line in $testo -replace(";" , ","}
i receive thi error:
+ ForEach-Object {$line in <<<< $testo -replace (";" , ","}
+ CategoryInfo : ParserError: (in:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
How can i corret this instruction ?
Sorry but i'm newbie using powershell :-(