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 Forum
When a class is both an inherited class of another, and alsoimplements an interface method .NET General
Access a static member on a nested static class. PowerShell
Access a static member on a nested static class. PowerShell
Is easier WMI static class access in the works for 1.1+? PowerShell
Async WCF method call, not using the proxy generated class Indigo