"Brandon Shell" asked:> I have seen adding psbase to alot of things "fixes" problems... What is this > psbase (thingy) and why do I have to use it? > There are lots of different object & data technologies in the world, each with their own particulars. Most of us never care about those particulars, we want the data and functions and that is that. The particulars get in the way of our problem solving. The clearest example of this is XML. Just try to get your data out of XML - it's a nightmere. With that as a backdrop, PowerShell "adapts" various object technologies to provide a standardized object view of them. Another way to think of it is that we project an normalized Object VIEW the same way that a database projects a VIEW of various data tables (there are good reason's why those tables exist they way they exist but as a user - they are not want I want so the DBA creates a VIEW). So then what happens if the particular problem you are solving actually needs the particulars of the underlying technology? That is where PSBASE comes in, it gives you RAW access to the object itself. We actually provide a number of VIEWS of the object:
PSBASE
the raw view of the object
PSADAPTED
the fully adapted view of the object
PSEXTENDED
just the extended elements of the object
PSOBJECT
a view of the adapter itself
PS> $x=[xml]"<root><a/></root>"PS> $x.psbaseNodeType : DocumentParentNode :DocumentType :Implementation : System.Xml.XmlImplementationName : #documentLocalName : #documentDocumentElement : rootOwnerDocument :Schemas : System.Xml.Schema.XmlSchemaSetXmlResolver :NameTable : System.Xml.NameTablePreserveWhitespace : FalseIsReadOnly : FalseInnerXml : <root><a /></root>SchemaInfo : System.Xml.Schema.XmlSchemaInfoBaseURI :Value :ChildNodes : {root}PreviousSibling :NextSibling :Attributes :FirstChild : rootLastChild : rootHasChildNodes : TrueNamespaceURI :Prefix :InnerText :OuterXml : <root><a /></root>PS> $x.psadaptedroot----rootPS> $x.psobjectMembers : {RefineType, AsTable, MSDN, Google...}Properties : {root}Methods : {RefineType, AsTable, MSDN, Google...}ImmediateBaseObject : #documentBaseObject : #documentTypeNames : {System.Xml.XmlDocument, System.Xml.XmlNode, System.Object}
I don’t have any extensions on XML but I’ve put a number on Process objects so let’s switch objects to show that:
PS> $p = gps powershellPS> $p.psextended |fl *__NounName : ProcessName : powershellHandles : 861VM : 202080256WS : 42684416PM : 40816640NPM : 9764Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exeCompany : Microsoft CorporationCPU : 8.78125FileVersion : 6.0.6000.16386 (winmain(wmbla).061024-0942)ProductVersion : 6.0.6000.16386Description : PowerShell.EXEProduct : Microsoftr Windowsr Operating System
Enjoy!
Jeffrey Snover [MSFT]Windows PowerShell/MMC ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx