function Get-ObjectInformation{<#.SYNOPSISA function used to explore object type information..DESCRIPTIONThe Get-ObjectInformation function provides access to otherwiseburied .NET reflection functionality. There is a large collection ofswitch parameters to help give a large sample of the members foran object passed to the function..NOTESAuthor: Will Steele (wlsteele@gmail.com)Last edited date: 7/19/2012Version 1.0Some of these will return large collections, depending on the assemblybeing referenced, so, it is sometimes a good idea to write to a variablefirst, examine the object size (using .Count) and select -first 5. Onceyou have a small sample set you can then determine which fields you needfor the specific investigation you are using. The key to realize hereis that many of these are in depth .NET objects and they have verylarge property collections..PARAMETER ObjectA mandatory parameter indicating the object to examine..PARAMETER GetConstructorsA switch parameter indicating whether it should return the constructorinformation or not. Default is False..PARAMETER GetCustomAttributesA switch parameter indicating whether it should return the CustomAttributes or not. Default is False..PARAMETER GetCustomAttributesDataA switch parameter indicating whether it should return theCustom Attributes Data or not. Default is False..PARAMETER GetExportedTypesA switch parameter indicating whether it should return the ExportedTypes or not. Default is False. NOTE: These are exported types ofthe assembly as a whole, not just for the referenced type..PARAMETER GetGenericArgumentsA switch parameter indicating whether it should return the GenericArguments or not. Default is False..PARAMETER GetHashCodeA switch parameter indicating whether it should return the HashCode or not. Default is False..PARAMETER GetLoadedModulesA switch parameter indicating whether it should return the LoadedModules or not. Default is False..PARAMETER GetManifestResourceNamesA switch parameter indicating whether it should return theManifest Resource Names or not. Default is False..PARAMETER GetMembersA switch parameter indicating whether it should return the Membersor not. Default is False..PARAMETER GetMethodsA switch parameter indicating whether it should return the Methodsor not. Default is False.
class="MsoNormal">
.PARAMETER GetModules
A switch parameter indicating whether it should return the Modules
or not. Default is False.
.PARAMETER GetName
A switch parameter indicating whether it should return the Name
or not. Default is False.
.PARAMETER GetReferencedAssemblies
A switch parameter indicating whether it should return the Referenced
Assemblies or not. Default is False.
.PARAMETER GetType
A switch parameter indicating whether it should return the Type
information or not. Default is False.
.PARAMETER Summary
A switch parameter indicating whether it should return the function
summary of which switches are $true. Default is False.
.INPUTS
Object
.OUTPUTS
Returns a variety of output pertaining to the input objects type
data.
.EXAMPLE 1
$string = "string"
Get-ObjectInformation -Object $string -GetType
System.String
.EXAMPLE 2
$psobject = New-Object -TypeName PSObject
Get-ObjectInformation -Object $psobject -GetExportedTypes | sort name
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True ActionPreference System.Enum
True True ActionPreferenceStopException System.Management.Automation.RuntimeException
True False AdapterCodeMethods System.Object
.
.
.
True False WSManConfigurationOption System.Management.Automation.PSTransportOption
True False WSManConnectionInfo System.Management.Automation.Runspaces.RunspaceConnection...
True False WSManServerChannelEvents System.Object
.EXAMPLE 3
$contentservice = New-WebServiceProxy -Uri http://services.msdn.microsoft.com/ContentServices/ContentService.asmx -Namespace contentservice
Get-ObjectInformation -Object $contentservice -GetReferencedAssemblies -Summary
Version Name
------- ----
4.0.0.0 mscorlib
4.0.0.0 System.Web.Services
4.0.0.0 System
4.0.0.0 System.Xml
--- Information Summary ---