@@ -42,141 +42,89 @@ Check out our **[documentation](https://github.com/SeeminglyScience/ClassExplore
42
42
Install-Module ClassExplorer -Scope CurrentUser
43
43
```
44
44
45
+ ### PowerShellGet v3
46
+
47
+ ``` powershell
48
+ Install-PSResource ClassExplorer
49
+ ```
50
+
45
51
### Source
46
52
47
53
``` powershell
48
54
git clone 'https://github.com/SeeminglyScience/ClassExplorer.git'
49
55
Set-Location ./ClassExplorer
50
- Install-Module platyPS, Pester, InvokeBuild -Force
51
- Import-Module platyPS, Pester, InvokeBuild
52
- Invoke-Build -Task Install
56
+ ./build.ps1
53
57
```
54
58
55
59
## Usage
56
60
57
61
### Find an accessible version of an abstract type
58
62
59
63
``` powershell
60
- $type = Find-Type RunspaceConnectionInfo
61
- $type
62
-
63
- # IsPublic IsSerial Name BaseType
64
- # -------- -------- ---- --------
65
- # True False RunspaceConnectionInfo System.Object
66
-
67
- $children = Find-Type -InheritsType $type
68
- $children
69
-
70
- # IsPublic IsSerial Name BaseType
71
- # -------- -------- ---- --------
72
- # True False WSManConnectionInfo System.Management.Automation.Runspac...
73
- # True False NamedPipeConnectionInfo System.Management.Automation.Runspac...
74
- # True False SSHConnectionInfo System.Management.Automation.Runspac...
75
- # True False VMConnectionInfo System.Management.Automation.Runspac...
76
- # True False ContainerConnectionInfo System.Management.Automation.Runspac...
77
-
78
- $accessible = $children | Find-Type { $_ | Find-Member -MemberType Constructor }
79
- $accessible
80
-
81
- # IsPublic IsSerial Name BaseType
82
- # -------- -------- ---- --------
83
- # True False WSManConnectionInfo System.Management.Automation.Runspac...
84
- # True False NamedPipeConnectionInfo System.Management.Automation.Runspac...
85
- # True False SSHConnectionInfo System.Management.Automation.Runspac...
86
-
87
- $accessible[1] | Find-Member -MemberType Constructor | Get-Parameter
88
-
89
- # Member: Void .ctor(Int32)
90
- #
91
- # # ParameterType Name IsIn IsOut IsOpt
92
- # - ------------- ---- ---- ----- -----
93
- # 0 Int32 processId False False False
94
- #
95
- # Member: Void .ctor(Int32, System.String)
96
- #
97
- # # ParameterType Name IsIn IsOut IsOpt
98
- # - ------------- ---- ---- ----- -----
99
- # 0 Int32 processId False False False
100
- # 1 String appDomainName False False False
101
- #
102
- # Member: Void .ctor(Int32, System.String, Int32)
103
- #
104
- # # ParameterType Name IsIn IsOut IsOpt
105
- # - ------------- ---- ---- ----- -----
106
- # 0 Int32 processId False False False
107
- # 1 String appDomainName False False False
108
- # 2 Int32 openTimeout False False False
64
+ Find-Type RunspaceConnectionInfo
65
+ ```
66
+
67
+ ![ Example-1-Results-1] ( https://user-images.githubusercontent.com/24977523/164984679-8a32dc97-e2a2-46ff-9d4f-e322b866c061.png )
68
+
69
+ ``` powershell
70
+ Find-Type -InheritsType System.Management.Automation.Runspaces.RunspaceConnectionInfo
71
+ ```
72
+
73
+ ![ Example-1-Results-2] ( https://user-images.githubusercontent.com/24977523/164984851-1a20380d-452f-463f-b21c-2931f9ea852f.png )
74
+
75
+ ``` powershell
76
+ Find-Type -InheritsType System.Management.Automation.Runspaces.RunspaceConnectionInfo |
77
+ Find-Type { $_ | Find-Member -MemberType Constructor }
78
+ ```
79
+
80
+ ![ Example-1-Results-3] ( https://user-images.githubusercontent.com/24977523/164984898-0f5ca28f-a462-45c0-a4f9-1b60f95b7a86.png )
81
+
82
+ ``` powershell
83
+ [Management.Automation.Runspaces.NamedPipeConnectionInfo] |
84
+ Find-Member -MemberType Constructor |
85
+ Get-Parameter
86
+ ```
87
+
88
+ ![ Example-1-Results-4] ( https://user-images.githubusercontent.com/24977523/164985845-4e7830ff-8507-46dd-b3a5-908aaa38a135.png )
109
89
90
+ ``` powershell
110
91
# Or, alternatively this will return all constructors, properties, methods, etc that return any
111
92
# implementation of RunspaceConnectionInfo.
112
93
Find-Member -ReturnType System.Management.Automation.Runspaces.RunspaceConnectionInfo
113
-
114
94
```
115
95
96
+ ![ Example-1-Results-5] ( https://user-images.githubusercontent.com/24977523/164985973-4c011ee8-6107-4126-9984-ffa595b0ad58.png )
97
+
116
98
### Find something to do with a type
117
99
118
100
``` powershell
119
101
using namespace System.Management.Automation.Runspaces
120
102
121
103
Find-Member -ParameterType RunspaceConnectionInfo -ReturnType RunspacePool
104
+ ```
105
+
106
+ ![ Example-2-Results] ( https://user-images.githubusercontent.com/24977523/164986057-ca7cfba9-182b-4c99-8dd2-a33941922b54.png )
107
+
108
+ ### Use type signature queries
109
+
110
+ See [ about_Type_Signatures.help.md] ( ./docs/en-US/about_Type_Signatures.help.md )
122
111
123
- # ReflectedType: RunspaceFactory
124
- #
125
- # Name MemberType Definition
126
- # ---- ---------- ----------
127
- # CreateRunspacePool Method public static RunspacePool CreateRunspacePool(int minRunspaces…
128
- # CreateRunspacePool Method public static RunspacePool CreateRunspacePool(int minRunspaces…
129
- # CreateRunspacePool Method public static RunspacePool CreateRunspacePool(int minRunspaces…
130
- # CreateRunspacePool Method public static RunspacePool CreateRunspacePool(int minRunspaces…
131
- #
132
- # ReflectedType: RunspacePool
133
- #
134
- # Name MemberType Definition
135
- # ---- ---------- ----------
136
- # GetRunspacePools Method public static RunspacePool[] GetRunspacePools(RunspaceConnecti…
137
- # GetRunspacePools Method public static RunspacePool[] GetRunspacePools(RunspaceConnecti…
138
- # GetRunspacePools Method public static RunspacePool[] GetRunspacePools(RunspaceConnecti…
112
+ ``` powershell
113
+ Find-Member -ReturnType { [ReadOnlySpan[byte]] } -ParameterType { [ReadOnlySpan[any]] }
139
114
```
140
115
116
+ ![ Example-3-Results] ( https://user-images.githubusercontent.com/24977523/164994773-84f42529-9a8d-46e8-8982-f42f054c2a80.png )
117
+
141
118
### Get real specific
142
119
143
120
``` powershell
144
- $findMemberSplat = @{
145
- MemberType = 'Method'
146
- RegularExpression = $true
147
- Name = '^(?!Should(Continue|Process))'
148
- ReturnType = [bool]
149
- ParameterType = [string]
150
- Instance = $true
151
- }
152
-
153
- Find-Member @findMemberSplat -FilterScript {
154
- $parameters = $_ | Get-Parameter
155
- $parameters.ParameterType.IsByRef -contains $true -and
156
- $parameters.Count -gt 3
157
- }
158
-
159
- # ReflectedType: System.ComponentModel.MaskedTextProvider
160
- #
161
- # Name MemberType IsStatic Definition
162
- # ---- ---------- -------- ----------
163
- # InsertAt Method False Boolean InsertAt(String input, Int32 position, Int32...
164
- # Replace Method False Boolean Replace(String input, Int32 position, Int32&...
165
- # Replace Method False Boolean Replace(String input, Int32 startPosition, I...
166
- #
167
- # ReflectedType: System.Web.Util.RequestValidator
168
- #
169
- # Name MemberType IsStatic Definition
170
- # ---- ---------- -------- ----------
171
- # InvokeIsValidRequ... Method False Boolean InvokeIsValidRequestString(HttpContext conte...
172
- #
173
- # ReflectedType: System.Activities.XamlIntegration.ICompiledExpressionRoot
174
- #
175
- # Name MemberType IsStatic Definition
176
- # ---- ---------- -------- ----------
177
- # CanExecuteExpression Method False Boolean CanExecuteExpression(String expressionText, ...
121
+ Find-Member -MemberType Method -Instance -ParameterType string -ReturnType bool -ParameterCount 4.. |
122
+ Find-Member -ParameterType { [anyref] [any] } |
123
+ Find-Member -Not -RegularExpression 'Should(Continue|Process)'
178
124
```
179
125
126
+ ![ Example-4-Results] ( https://user-images.githubusercontent.com/24977523/164995061-21e0c627-fd05-43d4-b831-f901bfc31fd2.png )
127
+
180
128
## Contributions Welcome!
181
129
182
130
We would love to incorporate community contributions into this project. If you would like to
0 commit comments