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
Extension Methods for WPF Window
I am trying to add extension methods for the WPF Window type. namespace WpfSettingsApp { public static class WindowExtensions { public static...
.NET General
get help on methods and properties
hi, if i do a get-childitem | get-member i get all methods and properties for the cmlet. great! 1) how do i get help for a method to find out...
PowerShell
Calling methods on DataContracts
Hi, I have this requirement that a web service be used to return an object that the client can call methods on. For e.g: WebServiceClient c =...
Indigo
Win32_NetworkAdapterConfiguration methods and properties
http://lantoolbox.com/network-administration/articles/performing-networking-tasks-managing-dhcp-from-powershell/
PowerShell
static methods
I have a DLL with two methods one static and one not. public static int Test1(int p) { return 1; } public int Test2(int p) { return 2;} I use...
PowerShell
Calling base methods BeginProcessing, EndProcessing, ProcessRecord
A few web tutorials presenting custom CmdLets are calling the base methods BeginProcessing, EndProcessing, ProcessRecord. But are those calls really...
PowerShell
Output Methods
Hi Are there any output or format methods that are not "talking" that much? Example 1: get-childitem 'C:\Program Files' -include excel*...
PowerShell