Just to make sure we're answering the right question...

Both WriteLine() and MessageBox() are functions that return a value.

If you don't care about the return value then supress the code using a variable assignment otherwise it will appear on the console, i.e.
code:
$Nul=WriteLine(...

and
code:
$Nul=MessageBox(...