Several of the methods on StringBuilder like Append IIRC, return the StringBuilder so you can call more StringBuilder methods. However the way PowerShell works is that it outputs all results (return values in the case of .NET method calls). In this case, cast the result to [void] to ignore the return value e.g.:
[void]$sb.Append($c)
Note that you don’t need to end lines in ; in PowerShell. However if you put multiple commands on the same line then use ;‘ to separate those commands.