@@ -3,7 +3,7 @@ external help file: PSModule-help.xml
3
3
keywords : powershell,cmdlet
4
4
locale : en-us
5
5
Module Name : PowerShellGet
6
- ms.date : 06/09/2017
6
+ ms.date : 6/5/2019
7
7
online version : http://go.microsoft.com/fwlink/?LinkId=822321
8
8
schema : 2.0.0
9
9
title : Find-RoleCapability
@@ -16,81 +16,122 @@ Finds role capabilities in modules.
16
16
17
17
## SYNTAX
18
18
19
+ ### All
20
+
19
21
```
20
- Find-RoleCapability [[-Name] <String[]>] [-ModuleName <String>] [-MinimumVersion <String>]
21
- [-MaximumVersion <String>] [-RequiredVersion <String>] [-AllVersions] [-AllowPrerelease] [-Tag <String[]>]
22
- [-Filter <String>] [-Proxy <Uri >] [-ProxyCredential <PSCredential >] [-Repository <String[]>]
23
- [<CommonParameters>]
22
+ Find-RoleCapability [[-Name] <String[]>] [-ModuleName <String>] [-MinimumVersion <String>]
23
+ [-MaximumVersion <String>] [-RequiredVersion <String>] [-AllVersions] [-AllowPrerelease]
24
+ [-Tag <String[] >] [-Filter <String >] [-Proxy <Uri >] [-ProxyCredential <PSCredential>]
25
+ [-Repository <String[]>] [<CommonParameters>]
24
26
```
25
27
26
28
## DESCRIPTION
27
- The ** Find-RoleCapability** cmdlet finds PowerShell role capabilities in modules.
28
- ** Find-RoleCapability** searches modules in registered repositories.
29
29
30
- For each role capability that this cmdlet finds, it returns a ** PSGetRoleCapabilityInfo** object.
31
- You can pass a ** PSGetRoleCapabilityInfo** object to the Install-Module cmdlet to install the module that contains the role capability.
30
+ The ` Find-RoleCapability ` cmdlet searches registered repositories to find PowerShell role
31
+ capabilities and modules.
32
+
33
+ For each role capability found by ` Find-RoleCapability ` , a ** PSGetRoleCapabilityInfo** object is
34
+ returned. ** PSGetRoleCapabilityInfo** objects can be sent down the pipeline to the ` Install-Module `
35
+ or ` Save-Module ` cmdlets.
32
36
33
- PowerShell role capabilities define which commands, applications, and so on are available to a user at a Just Enough Administration (JEA) endpoint.
34
- Role capabilities are defined by files with a .psrc extension.
37
+ PowerShell role capabilities define which commands and applications are available to a user at a
38
+ Just Enough Administration (JEA) endpoint. Role capabilities are defined by files with a ` .psrc `
39
+ extension.
35
40
36
41
## EXAMPLES
37
42
38
- ### Example 1: Find all role capabilities
39
- ```
40
- PS C:\> Find-RoleCapability
41
- Name Version ModuleName Repository
42
- ---- ------- ---------- ----------
43
- Maintenance 1.0 Demo_Module PSGallery
44
- MyJeaRole 0.0.3 MyJeaModule PSGallery
45
- MyRoleCap 0.2.0.6 MyRoleCapabilityModule PSGallery
43
+ ### Example 1: Find role capabilities
44
+
45
+ ` Find-RoleCapability ` finds role capabilities in each registered repository. To search a specific
46
+ repository, use the ** Repository** parameter.
47
+
48
+ ``` powershell
49
+ Find-RoleCapability
46
50
```
47
51
48
- This command finds all role capabilities.
52
+ ``` output
53
+ Name Version ModuleName Repository
54
+ ---- ------- ---------- ----------
55
+ General-Lev1 1.0 JeaExamples PSGallery
56
+ General-Lev2 1.0 JeaExamples PSGallery
57
+ IIS-Lev1 1.0 JeaExamples PSGallery
58
+ IIS-Lev2 1.0 JeaExamples PSGallery
59
+ ```
49
60
50
61
### Example 2: Find role capabilities by name
62
+
63
+ ` Find-RoleCapability ` finds role capabilities by name. Use commas to separate an array of names.
64
+
65
+ ``` powershell
66
+ Find-RoleCapability -Name General-Lev1, IIS-Lev2
51
67
```
52
- PS C:\> Find-RoleCapability -Name "Maintenance,MyJeaRole"
53
- Name Version ModuleName Repository
54
- ---- ------- ---------- ----------
55
- Maintenance 1.0 Demo_Module PSGallery
56
- MyJeaRole 0.0.3 MyJeaModule PSGallery
68
+
69
+ ``` output
70
+ Name Version ModuleName Repository
71
+ ---- ------- ---------- ----------
72
+ General-Lev1 1.0 JeaExamples PSGallery
73
+ IIS-Lev2 1.0 JeaExamples PSGallery
57
74
```
58
75
59
- This command finds the role capabilities named Maintenance and MyJeaRole.
76
+ ### Example 3: Find and save a role capability's module
77
+
78
+ The ` Find-RoleCapability ` cmdlet finds a role capability and sends the object down the pipeline.
79
+ ` Save-Module ` saves the role capability's module to a file system. ` Get-ChildItem ` displays the
80
+ contents of the module's directory.
60
81
61
- ### Example 3: Find role capabilities and save them
62
82
```
63
- PS C:\> Find-RoleCapability -Name "Maintenance,MyJeaRole" | Save-Module -Path "C:\MyModulesPath"
64
- PS C:\> Get-ChildItem -Path "C:\MyModulesPath"
83
+ PS> Find-RoleCapability -Name General-Lev1 | Save-Module -Path C:\Test\Modules
84
+
85
+ PS> Get-ChildItem -Path C:\Test\Modules\JeaExamples\1.0\
86
+
87
+ Directory: C:\Test\Modules\JeaExamples\1.0
88
+
65
89
Mode LastWriteTime Length Name
66
90
---- ------------- ------ ----
67
- d----- 11/18/2015 11:46 PM Demo_Module
68
- d----- 10/29/2015 6:32 PM MyJeaModule
91
+ d----- 6/4/2019 16:37 RoleCapabilities
92
+ -a---- 2/5/2019 18:46 1702 CreateRegisterPSSC.ps1
93
+ -a---- 2/5/2019 18:46 7656 JeaExamples.psd1
94
+ -a---- 10/1/2018 08:16 595 JeaExamples.psm1
69
95
```
70
96
71
- The first command finds the role capabilities named Maintenance and MyJeaRole, and uses the pipeline operator to pass them to Save-Module, which saves the modules that contain the role capabilities to a local folder.
97
+ ` Find-RoleCapability ` uses the ** Name** parameter to specify the ** General-Lev1** role capability.
98
+ The object is sent down the pipeline. ` Save-Module ` uses the ** Path** parameter for the file system
99
+ location to save the module. After the module is saved, ` Get-ChildItem ` specifies the module's
100
+ ** Path** and displays the contents of the ** JeaExamples** module's directory.
72
101
73
- The second command uses Get-ChildItem to get the items saved with the prior command.
102
+ ### Example 4: Find and install a role capability's module
103
+
104
+ ` Find-RoleCapability ` finds the module and sends the object down the pipeline. ` Install-Module `
105
+ installs the module. After the installation, use ` Get-InstalledModule ` to see the results.
74
106
75
- ### Example 4: Find role capabilities and install them
76
- ```
77
- PS C:\> Find-RoleCapability -Name "Maintenance,MyJeaRole" | Install-Module
78
- PS C:\> Get-InstalledModule
79
- Version Name Type Repository Description
80
- ------- ---- ---- ---------- -----------
81
- 1.0 Demo_Module Module PSGallery JEA RoleCapabilities
82
- 0.0.3 MyJeaModule Module PSGallery MyJeaModule description
83
107
```
108
+ PS> Find-RoleCapability -Name General-Lev1 | Install-Module -Verbose
84
109
85
- The first command finds the role capabilities named Maintenance and MyJeaRole, and uses the pipeline operator to pass them to Install-Module, which installs the modules.
110
+ VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/JeaExamples/1.0.0'.
111
+ VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/JeaExamples/1.0.0'.
112
+ VERBOSE: Completed downloading 'JeaExamples'.
113
+ VERBOSE: InstallPackageLocal' - name='JeaExamples', version='1.0',
114
+ VERBOSE: Validating the 'JeaExamples' module contents
115
+ VERBOSE: Test-ModuleManifest successfully validated the module manifest file
116
+ VERBOSE: Module 'JeaExamples' was installed successfully to path
86
117
87
- The second command gets the installed modules.
118
+ PS> Get-InstalledModule
119
+
120
+ Version Name Repository Description
121
+ ------- ---- ---------- -----------
122
+ 1.0 JeaExamples PSGallery Some example Jea roles for general server maintenance...
123
+ ```
124
+
125
+ ` Find-RoleCapability ` uses the ** Name** parameter to specify the ** General-Lev1** role capability.
126
+ The object is sent down the pipeline. ` Install-Module ` uses the ** Verbose** parameter to display
127
+ status messages during the installation. After the install is finished, the ` Get-InstalledModule `
128
+ output confirms that the ** JeaExamples** module was installed.
88
129
89
130
## PARAMETERS
90
131
91
132
### -AllowPrerelease
92
- Includes in the results resources marked as a prerelease.
93
133
134
+ Includes resources marked as a prerelease in the results.
94
135
95
136
``` yaml
96
137
Type : SwitchParameter
@@ -105,7 +146,9 @@ Accept wildcard characters: False
105
146
` ` `
106
147
107
148
### -AllVersions
108
- Indicates that this cmdlet gets all versions of a module.
149
+
150
+ Indicates that this cmdlet gets all versions of a module. The **AllVersions** parameter displays
151
+ each of a module's available versions.
109
152
110
153
` ` ` yaml
111
154
Type : SwitchParameter
@@ -120,8 +163,9 @@ Accept wildcard characters: False
120
163
` ` `
121
164
122
165
### -Filter
123
- Finds modules based on the PackageManagement provider-specific search syntax.
124
- For NuGet, this is the equivalent of using the search bar on the PowerShell Gallery website.
166
+
167
+ Finds resources based on the **PackageManagement** provider's search syntax. For example, specify
168
+ words to search for within the **ModuleName** and **Description** properties.
125
169
126
170
` ` ` yaml
127
171
Type : String
@@ -137,6 +181,9 @@ Accept wildcard characters: False
137
181
138
182
### -MaximumVersion
139
183
184
+ Specifies the maximum version of the module to include in results. The **MaximumVersion** and the
185
+ **RequiredVersion** parameters can't be used in the same command.
186
+
140
187
` ` ` yaml
141
188
Type : String
142
189
Parameter Sets : (All)
@@ -150,8 +197,9 @@ Accept wildcard characters: False
150
197
` ` `
151
198
152
199
### -MinimumVersion
153
- Specifies the minimum version of the module to include in results.
154
- The *MinimumVersion* and the *RequiredVersion* parameters are mutually exclusive; you cannot use both parameters in the same command.
200
+
201
+ Specifies the minimum version of the module to include in results. The **MinimumVersion** and the
202
+ **RequiredVersion** parameters can't be used in the same command.
155
203
156
204
` ` ` yaml
157
205
Type : String
@@ -166,8 +214,9 @@ Accept wildcard characters: False
166
214
` ` `
167
215
168
216
### -ModuleName
169
- Specifies the name of the module in which to search for role capabilities.
170
- The default is all modules.
217
+
218
+ Specifies the name of the module in which to search for role capabilities. The default is all
219
+ modules.
171
220
172
221
` ` ` yaml
173
222
Type : String
@@ -182,7 +231,9 @@ Accept wildcard characters: False
182
231
` ` `
183
232
184
233
### -Name
185
- Specifies an array of names of role capabilities to search for.
234
+
235
+ Specifies the name of a role capability. The default is all role capabilities. Use commas to
236
+ separate an array of resource names.
186
237
187
238
` ` ` yaml
188
239
Type : String[]
@@ -197,7 +248,8 @@ Accept wildcard characters: False
197
248
` ` `
198
249
199
250
### -Proxy
200
- Specifies a proxy server for the request, rather than connecting directly to the Internet resource.
251
+
252
+ Specifies a proxy server for the request, rather than a direct connection to the internet resource.
201
253
202
254
` ` ` yaml
203
255
Type : Uri
@@ -212,7 +264,9 @@ Accept wildcard characters: False
212
264
` ` `
213
265
214
266
### -ProxyCredential
215
- Specifies a user account that has permission to use the proxy server that is specified by the **Proxy** parameter.
267
+
268
+ Specifies a user account with permission to use the proxy server specified in the **Proxy**
269
+ parameter.
216
270
217
271
` ` ` yaml
218
272
Type : PSCredential
@@ -227,8 +281,9 @@ Accept wildcard characters: False
227
281
` ` `
228
282
229
283
### -Repository
230
- Specifies an array of registered repositories in which to search.
231
- The default is all repositories.
284
+
285
+ Specifies a repository to search for role capabilities. Use commas to separate an array of
286
+ repository names.
232
287
233
288
` ` ` yaml
234
289
Type : String[]
@@ -243,7 +298,9 @@ Accept wildcard characters: False
243
298
` ` `
244
299
245
300
### -RequiredVersion
246
- Specifies the version of the module to include in the results.
301
+
302
+ Specifies the module's exact version number to include in the results. The **RequiredVersion** and
303
+ the **MinimumVersion** parameters can't be used in the same command.
247
304
248
305
` ` ` yaml
249
306
Type : String
@@ -258,7 +315,8 @@ Accept wildcard characters: False
258
315
` ` `
259
316
260
317
### -Tag
261
- Specifies an array of tags.
318
+
319
+ Specifies tags that categorize modules in a repository. Use commas to separate an array of tags.
262
320
263
321
` ` ` yaml
264
322
Type : String[]
@@ -273,14 +331,29 @@ Accept wildcard characters: False
273
331
` ` `
274
332
275
333
### CommonParameters
276
- This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
334
+
335
+ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
336
+ -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
337
+ -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
277
338
278
339
## INPUTS
279
340
280
341
## OUTPUTS
281
342
343
+ ### PSGetRoleCapabilityInfo
344
+
345
+ The ` Find-RoleCapability` cmdlet returns a **PSGetRoleCapabilityInfo** object.
346
+
282
347
# # NOTES
283
348
284
349
# # RELATED LINKS
285
350
286
- ## RELATED LINKS
351
+ [Get-ChildItem](../Microsoft.PowerShell.Management/Get-ChildItem.md)
352
+
353
+ [Get-InstalledModule](Get-InstalledModule.md)
354
+
355
+ [Install-Module](Install-Module.md)
356
+
357
+ [New-PSRoleCapabilityFile](../Microsoft.PowerShell.Core/New-PSRoleCapabilityFile.md)
358
+
359
+ [Save-Module](Save-Module.md)
0 commit comments