Windows Vista Forums

how to call a static method in a .net class from powershell?

  1. #1


    YY Guest

    how to call a static method in a .net class from powershell?

    I know how to call an instance method from PSH, but who can tell me how to
    call a static method?



      My System SpecsSystem Spec

  2. #2


    Jeff Guest

    Re: how to call a static method in a .net class from powershell?

    On Sep 11, 12:40 pm, YY <Y...@xxxxxx> wrote:

    > I know how to call an instance method from PSH, but who can tell me how to
    > call a static method?
    [ClassName]::StaticProperty or [ClassName]::StaticMethod(), for
    example:

    PSH$ [System.DateTime]::Now
    11 September 2007 12:48:54

    PSH$ [regex]::Split( "System.Text.RegularExpressions.Regex", "\." )
    System
    Text
    RegularExpressions
    Regex

    Jeff Hillman


      My System SpecsSystem Spec

how to call a static method in a .net class from powershell?

Similar Threads
Thread Thread Starter Forum Replies Last Post
When a class is both an inherited class of another, and alsoimplements an interface method Curious .NET General 1 14 Aug 2009
Access a static member on a nested static class. matthew.ashton@gmail.com PowerShell 3 28 Feb 2007
Access a static member on a nested static class. matthew.ashton@gmail.com PowerShell 0 28 Feb 2007
Is easier WMI static class access in the works for 1.1+? Alex K. Angelopoulos [MVP] PowerShell 0 15 Sep 2006
Async WCF method call, not using the proxy generated class ewolfman Indigo 3 04 Jul 2006