Zett42 has the right answer: I added Clear-Host to the script and that cleared the whole terminal coloring the background the color I set $host.ui.rawui.backgroundcolor.
Clear-Host
$host.ui.rawui.backgroundcolor