PS C:\> get-content -path c:\temp\servers.txt # showing this to display servers.txt is populated
cbsexc001
cbsapp002
lncexc001
PS C:\> get-content -path c:\temp\servers.txt | foreach {Get-WmiObject win32_service} | select pscomputername, displayname, startname
PSComputerName displayname startname
-------------- ----------- ---------
SSMLXP600 Adobe Acrobat Update Service LocalSystem
SSMLXP600 Adobe Flash Player Update Service LocalSystem
SSMLXP600 Application Experience localSystem
SSMLXP600 Application Layer Gateway Service NT AUTHORITY\LocalSer
SSMLXP600 Application Identity NT Authority\LocalSer
SSMLXP600 Application Information LocalSystem
SSMLXP600 Application Management LocalSystem
SSMLXP600 ASP.NET State Service NT AUTHORITY\NetworkS
SSMLXP600 WebEx Service Host for Support Center LocalSystem
SSMLXP600 Windows Audio Endpoint Builder LocalSystem
SSMLXP600 Windows Audio NT AUTHORITY\LocalSer
SSMLXP600 ActiveX Installer (AxInstSV) LocalSystem
SSMLXP600 BitLocker Drive Encryption Service localSystem
SSMLXP600 Base Filtering Engine NT AUTHORITY\LocalSer
SSMLXP600 Background Intelligent Transfer Service LocalSystem
SSMLXP600 BlackBerry Device Manager LocalSystem
SSMLXP600 Computer Browser LocalSystem
i was expecting the computer to display what was in text file - not my local workstation. Where / Why is the coding wrong? i am expecting results from three servers