Windows Vista Forums

Calling Methods on ? pipes

  1. #1


    fixitchris Guest

    Calling Methods on ? pipes

    My brain is frozen....

    How can i call the .get_username() method on the piped $_?

    Get-EventLog -LogName security | ? { $_.eventid -eq 627 }

    and how can i pipe that username to ADD-content cmdlet?
    Thank you

      My System SpecsSystem Spec

  2. #2


    Adam Milazzo Guest

    Re: Calling Methods on ? pipes

    fixitchris wrote:
    > My brain is frozen....
    >
    > How can i call the .get_username() method on the piped $_?
    >
    > Get-EventLog -LogName security | ? { $_.eventid -eq 627 }
    >
    > and how can i pipe that username to ADD-content cmdlet?
    > Thank you


    Get-EventLog -LogName security | ? { $_.eventid -eq 627 } | % {
    $_.get_username() } | add-content ...

    ?

      My System SpecsSystem Spec


Calling Methods on ? pipes
Similar Threads
Thread Forum
get help on methods and properties PowerShell
Calling methods on DataContracts Indigo
static methods PowerShell
Calling base methods BeginProcessing, EndProcessing, ProcessRecord PowerShell
Output Methods PowerShell