ClassExplorer is a PowerShell module that enables quickly searching the AppDomain for classes and members.
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to seeminglyscience@gmail.com.
AppVeyor (Windows) | CircleCI (Linux) | CodeCov |
---|---|---|
- Quickly find specific classes, methods, properties, etc
- Use builtin parameters that utilize compiled filters for performance
- Create a fully custom search using a ScriptBlock
- Supported for PowerShell Core (tested in Windows and Linux)
- Type name completion on any Type parameters
- All string parameters accept wildcards (or regex with a switch parameter)
Check out our documentation for information about how to use this project.
Install-Module ClassExplorer -Scope CurrentUser
git clone 'https://github.com/SeeminglyScience/ClassExplorer.git'
Set-Location ./ClassExplorer
Install-Module platyPS, Pester, InvokeBuild -Force
Import-Module platyPS, Pester, InvokeBuild
Invoke-Build -Task Install
$type = Find-Type RunspaceConnectionInfo
$type
# IsPublic IsSerial Name BaseType
# -------- -------- ---- --------
# True False RunspaceConnectionInfo System.Object
$children = Find-Type -InheritsType $type
$children
# IsPublic IsSerial Name BaseType
# -------- -------- ---- --------
# True False WSManConnectionInfo System.Management.Automation.Runspac...
# True False NamedPipeConnectionInfo System.Management.Automation.Runspac...
# True False SSHConnectionInfo System.Management.Automation.Runspac...
# True False VMConnectionInfo System.Management.Automation.Runspac...
# True False ContainerConnectionInfo System.Management.Automation.Runspac...
$accessible = $children | Find-Type { $_ | Find-Member -MemberType Constructor }
$accessible
# IsPublic IsSerial Name BaseType
# -------- -------- ---- --------
# True False WSManConnectionInfo System.Management.Automation.Runspac...
# True False NamedPipeConnectionInfo System.Management.Automation.Runspac...
# True False SSHConnectionInfo System.Management.Automation.Runspac...
$accessible[1] | Find-Member -MemberType Constructor | Get-Parameter
# Member: Void .ctor(Int32)
#
# # ParameterType Name IsIn IsOut IsOpt
# - ------------- ---- ---- ----- -----
# 0 Int32 processId False False False
#
# Member: Void .ctor(Int32, System.String)
#
# # ParameterType Name IsIn IsOut IsOpt
# - ------------- ---- ---- ----- -----
# 0 Int32 processId False False False
# 1 String appDomainName False False False
#
# Member: Void .ctor(Int32, System.String, Int32)
#
# # ParameterType Name IsIn IsOut IsOpt
# - ------------- ---- ---- ----- -----
# 0 Int32 processId False False False
# 1 String appDomainName False False False
# 2 Int32 openTimeout False False False
# Or, alternatively this will return all constructors, properties, methods, etc that return any
# implementation of RunspaceConnectionInfo.
Find-Member -ReturnType System.Management.Automation.Runspaces.RunspaceConnectionInfo
$takesType = [System.Management.Automation.Runspaces.RunspaceConnectionInfo]
$givesType = [System.Management.Automation.Runspaces.RunspacePool]
Find-Member -ParameterType $takesType -ReturnType $givesType
# ReflectedType: System.Management.Automation.Runspaces.RunspaceFactory
#
# Name MemberType IsStatic Definition
# ---- ---------- -------- ----------
# CreateRunspacePool Method True RunspacePool CreateRunspacePool(Int32 minRunspaces, ...
# CreateRunspacePool Method True RunspacePool CreateRunspacePool(Int32 minRunspaces, ...
# CreateRunspacePool Method True RunspacePool CreateRunspacePool(Int32 minRunspaces, ...
# CreateRunspacePool Method True RunspacePool CreateRunspacePool(Int32 minRunspaces, ...
#
# ReflectedType: System.Management.Automation.Runspaces.RunspacePool
#
# Name MemberType IsStatic Definition
# ---- ---------- -------- ----------
# GetRunspacePools Method True RunspacePool[] GetRunspacePools(RunspaceConnectionIn...
# GetRunspacePools Method True RunspacePool[] GetRunspacePools(RunspaceConnectionIn...
# GetRunspacePools Method True RunspacePool[] GetRunspacePools(RunspaceConnectionIn...
$findMemberSplat = @{
MemberType = 'Method'
RegularExpression = $true
Name = '^(?!Should(Continue|Process))'
ReturnType = [bool]
ParameterType = [string]
Instance = $true
}
Find-Member @findMemberSplat -FilterScript {
$parameters = $_ | Get-Parameter
$parameters.ParameterType.IsByRef -contains $true -and
$parameters.Count -gt 3
}
# ReflectedType: System.ComponentModel.MaskedTextProvider
#
# Name MemberType IsStatic Definition
# ---- ---------- -------- ----------
# InsertAt Method False Boolean InsertAt(String input, Int32 position, Int32...
# Replace Method False Boolean Replace(String input, Int32 position, Int32&...
# Replace Method False Boolean Replace(String input, Int32 startPosition, I...
#
# ReflectedType: System.Web.Util.RequestValidator
#
# Name MemberType IsStatic Definition
# ---- ---------- -------- ----------
# InvokeIsValidRequ... Method False Boolean InvokeIsValidRequestString(HttpContext conte...
#
# ReflectedType: System.Activities.XamlIntegration.ICompiledExpressionRoot
#
# Name MemberType IsStatic Definition
# ---- ---------- -------- ----------
# CanExecuteExpression Method False Boolean CanExecuteExpression(String expressionText, ...
We would love to incorporate community contributions into this project. If you would like to contribute code, documentation, tests, or bug reports, please read our Contribution Guide to learn more.