Question: I am using the following to get count from netstat but the count appears on the next line. Here is what I am doing

```
$LIST = (netstat -an|select-string 443|select-string "LISTENING").count
write "LISTENING:" $LIST >> D:\entNew.txt

```

output is:

```
LISTENING: 40

```

How do I get the output to write like this :

```
LISTENING:40 

```

Answer: 
In your case just test :

"LISTENING:$LIST" >> D:\entNew.txt

However, I would not use `>>` but `set-content` CmdLet, and I'd prefer use a regular expression to filter the output of netstat.
Here's a one liner that I did to test solutions that results in what you want.

```
"Listening:$((netstat -an | select-string "Listening").count)"

```