Add extra row in return query of PSCustomObject

I used the below query and in my answer one row add with all of the other rows value. how can i fix it?

$htm = @()
        
                ForEach($evt in $data)
           { 
             $htm += [PSCustomObject]@{  
             ServerName = $evt.ServerName
             EventID = $evt.EventID 
             EventType = $evt.EventType
             LogDay = $evt.LogDay 
             Count = $evt.LogCount }
           } 

May 31st, 2015 4:55am

You do not need a custom object and should not use one here.  This will give you the same output and will skip blank records.

$data | Select ServerName,EventID,EventType,LogDay,Count

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2015 10:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics