Tail and Pipeline Input

Topics: User Forum
Apr 4, 2012 at 7:05 PM

 

I am trying to send output from a command to Get-FileTail. 

   <<COMMAND>  |  tail  -Count  8

When I do this, I am getting the following error:

   Get-FileTail : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input
   or the input and its properties do not match any of the parameters that take pipeline input.
   At C:\Program Files\OmniBack\db40\customize\dp_sched.ps1:6 char:72
   + & "C:\Program Files\OmniBack\bin\omnirpt.exe" -report "dl_sched" | tail <<<<
        -Count 8
             + CategoryInfo          : InvalidArgument: (:PSObject) [Get-FileTail], ParameterBindingException
             + FullyQualifiedErrorId : InputObjectNotBound,Pscx.Commands.IO.GetFileTail Command

I am guessing that the "tail" command from PSCX is not setup to handle pipeline input.

Thoughts?

Coordinator
Apr 4, 2012 at 8:24 PM

The only pipeline input supported is for the Path and LiteralPath parameters.  So you could do this:

Get-ChildItem *.log | Get-FileTail -count 8
Apr 5, 2012 at 5:37 PM

 

Thanks Keith.  That worked.