Author Posts

July 24, 2015 at 2:19 am

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 🙂

July 24, 2015 at 2:43 am

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

July 24, 2015 at 3:50 am

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.

July 24, 2015 at 7:13 am

Thank you & glad you're enjoying the book