kostya....@googlemail.com
unread,Feb 12, 2013, 4:50:11 AM2/12/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi experts,
I have a following head-breaking problem. When I'm trying to execute script below, I get an error:
Error "=" operator: System error. (Fehler beim "="-Operator: Systemfehler.)
+ $data = <<<< Get-Content $log | % {
Here is this script:
$log = "C:\log file.txt"
$linePrefix = "PROCESS THIS LINE"
$trimStart = 25 #chars to ignore in the beginning
$started = 0
$data = Get-Content $log | % { if ($_.length -ge $trimstart) { $linedata = $_.substring($trimstart); $timesline = $linedata.startswith($lineprefix); if ($started -eq 0 -and $timesline) { $started = 1; }; if ($started) { if ($timesline) { $line = $linedata.substring($lineprefix.length).trimstart(); if ($line.contains(": ")) { write-output $line } } else { break; } } } }
However, if I execute it without "$data = " assignment, it works perfectly and returns me expected values. I've also tried following statement
$data = (...)
but with no success.
Could you please give me a hint why it does happen?