Click to See Complete Forum and Search --> : Echo in Windows Powershell


ninosbutrus
09-18-2007, 09:38 AM
I am trying to learn Windows Powershell so forgive if this sounds stupid. Basically I'm trying to count how many installed printers I have and then print it out on the screen with the output something like

There are 5 printers installed.

The code I am using is:

$count=Get-WmiObject Win32_Printer
echo 'There are' $count 'printers installed.'

But it prints it in this way:

There are
5
printers installed.

How can I get it to print on one line?

ninosbutrus
09-18-2007, 10:15 AM
Never mind.. I figured it out. Use Write-Host instead of echo. Cheers.