PSBASE view of Powershell Objects

Until today, I didn’t know that the PowerShell Objects are modified to a standardized view and do not contain all known methods that are available. Good thing is, it’s possible to use them anyway.

Source: http://blogs.msdn.com/b/powershell/archive/2006/11/24/what-s-up-with-psbase-psextended-psadapted-and-psobject.aspx

For an example, create an object using Get-WMIObject:

$obj = Get-WMIObject Win32_Service -Filter “Name=’Winmgmt'”
$svc.StartMode=’Manual’

Now to submit the changes, there’s a method “ChangeStartMode” in place. Yes, there’s a way using Invoke-WMIMethod, but it’s a modified way. Using “PSBASE” there are some new Methods available:


$svc.psbase.put()

http://blogs.msdn.com/b/powershell/archive/2006/11/24/what-s-up-with-psbase-psextended-psadapted-and-psobject.aspx 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s