1.    11 Sep 2007 #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.    11 Sep 2007 #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


Similar Threads
Thread Forum
When a class is both an inherited class of another, and alsoimplements an interface method
The code below doesn't compile (after I added ": IComparable" on the first line). Any advice on how to get it compiled? public class...
.NET General
How do you call a method?
I am trying this another way; I am writting ascrit that uses the following; Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly =...
VB Script
Access a static member on a nested static class.
Hi Everyone, I was playing around with Powershell yesterday, trying to write functions to act as a simple FTP client. I based my code around the...
PowerShell
Access a static member on a nested static class.
Hi Everyone, I was playing around with Powershell yesterday, trying to write functions to act as a simple FTP client. I based my code around the...
PowerShell
x:Static with constants won't work (weird error + Class not found)
I am trying to use a constant in a resource defined in my App.xaml. Everything's fine when it's hardcoded, but when I put in an {x:Static...
Avalon
Is easier WMI static class access in the works for 1.1+?
First of all, my compliments on the fact that Get-WmiObject -List _does_ return static class references. There are times when you absolutely need...
PowerShell
Async WCF method call, not using the proxy generated class
Hi, I attempted to perform an async call to a WCF service, using the same technique for calling an async webservice method (Begin/End...
Indigo

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • PC Help Forum
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 04:46.
    .