Link to home
Start Free TrialLog in
Avatar of compdigit44
compdigit44

asked on

Get-EventLog unable to read from Text File

I am trying to use the Get-Eventlog commandlet to search a list of computer to select event ID's. When I try to run it it keeps getting the message null value to accepted. When I type in the get-content for my text file is list all devices in my file correctly. What am I doing wrong.


Get-Content c:\machines_List.txt | Foreach-Object {Get-EventLog -LogName application -EntryType Error -ComputerName $_ | ?{$_.eventid -like "1000"}
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of compdigit44
compdigit44

ASKER

good point, I will check again.