TypeName

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Richard Siddaway Richard Siddaway 2 years ago.

  • Author
    Posts
  • #27849
    Profile photo of Graham Beer
    Graham Beer
    Participant

    I was looking at the results of Get-Member and when looking at the type name looks like a .NET class. So for example,

    get-service | gm
    

    The Typename is System.ServiceProcess.ServiceController

    So If i tried this:

    [System.ServiceProcess.ServiceController]::GetServices("LAP777777")
    

    Is this using .NET natively ?
    Is this what they mean by PowerShell built on .NET ?
    Are all the methods under Get-Member getting you to use .NET natively ?

    Thanks as always 🙂

  • #27850
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    PowerShell is built on .NET. It uses .NET objects (sometimes modified) for all its output so when you get services, processes, AD objects or anything else you are dealing with a .NET object.

    You can use the .NET classes directly but its more work. PowerShell abstracts the underlying .NET so you don't have to discover how the class works

  • #27851
    Profile photo of Graham Beer
    Graham Beer
    Participant

    Thanks Richard, really honored you replied to my post 🙂

    Just wanted to add i've bought your PowerShell and WMI book and really enjoying it.

  • #27860
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

    Thank you & glad you're enjoying the book

You must be logged in to reply to this topic.