output wrong way

I created csv file by script. I like to output full data and filtered data separating by “+”

However, I always get “+” on the top and full data and filtered data together.

import-csv .\tempdata.csv

write-host '+++++++++' -Backgroundcolor Yellow

import-csv .\tempdata.csv |where {$_.hostname -notmatch "2xx"}

Here is my output

+++++++++++++++++++++++

10.10.101.111   K-2xx1234

10.10.101.123  K-3wxy123

10.10.101.31    K-1wxy234

10.10.101.123  K-3wxy123

10.10.101.31    K-1wxy234

One more question: I learn from here but I forgot the correct syntax

write-output "The folder name is $1 and file name is $2" -f $a, $b

Can someone remind me the correct syntax?

Thanks in advance

This will be a simple one, but before showing up the solution can you explain a little bit on how you expect the above code to work for the output you want. Based on that it’ll be easy to guide and tell you where the mistake has happened.

You can post the expected output as well…

my expected output:

10.10.101.111 K-2xx1234

10.10.101.123 K-3wxy123

10.10.101.31 K-1wxy234

+++++++++++++++++++++++

10.10.101.123 K-3wxy123

10.10.101.31 K-1wxy234