Skip to content

Commit 1bbe4bc

Browse files
davidsmatlaksdwheeler
authored andcommitted
Find-RoleCapability - fixed empty parameter placeholders, copyedits (#4403)
* fixed empty parameters, copyedits * fixed parameter set spacing * fixed header style
1 parent 36bedd0 commit 1bbe4bc

File tree

2 files changed

+246
-129
lines changed

2 files changed

+246
-129
lines changed

reference/5.1/PowershellGet/Find-RoleCapability.md

Lines changed: 133 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ external help file: PSModule-help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: PowerShellGet
6-
ms.date: 06/09/2017
6+
ms.date: 6/5/2019
77
online version: http://go.microsoft.com/fwlink/?LinkId=822321
88
schema: 2.0.0
99
title: Find-RoleCapability
@@ -16,81 +16,122 @@ Finds role capabilities in modules.
1616

1717
## SYNTAX
1818

19+
### All
20+
1921
```
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>]
2426
```
2527

2628
## DESCRIPTION
27-
The **Find-RoleCapability** cmdlet finds PowerShell role capabilities in modules.
28-
**Find-RoleCapability** searches modules in registered repositories.
2929

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.
3236

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.
3540

3641
## EXAMPLES
3742

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
4650
```
4751

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+
```
4960

5061
### 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
5167
```
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
5774
```
5875

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.
6081

61-
### Example 3: Find role capabilities and save them
6282
```
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+
6589
Mode LastWriteTime Length Name
6690
---- ------------- ------ ----
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
6995
```
7096

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.
72101

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.
74106

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
83107
```
108+
PS> Find-RoleCapability -Name General-Lev1 | Install-Module -Verbose
84109
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
86117
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.
88129

89130
## PARAMETERS
90131

91132
### -AllowPrerelease
92-
Includes in the results resources marked as a prerelease.
93133

134+
Includes resources marked as a prerelease in the results.
94135

95136
```yaml
96137
Type: SwitchParameter
@@ -105,7 +146,9 @@ Accept wildcard characters: False
105146
```
106147
107148
### -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.
109152
110153
```yaml
111154
Type: SwitchParameter
@@ -120,8 +163,9 @@ Accept wildcard characters: False
120163
```
121164
122165
### -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.
125169
126170
```yaml
127171
Type: String
@@ -137,6 +181,9 @@ Accept wildcard characters: False
137181
138182
### -MaximumVersion
139183
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+
140187
```yaml
141188
Type: String
142189
Parameter Sets: (All)
@@ -150,8 +197,9 @@ Accept wildcard characters: False
150197
```
151198
152199
### -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.
155203
156204
```yaml
157205
Type: String
@@ -166,8 +214,9 @@ Accept wildcard characters: False
166214
```
167215
168216
### -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.
171220
172221
```yaml
173222
Type: String
@@ -182,7 +231,9 @@ Accept wildcard characters: False
182231
```
183232
184233
### -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.
186237
187238
```yaml
188239
Type: String[]
@@ -197,7 +248,8 @@ Accept wildcard characters: False
197248
```
198249
199250
### -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.
201253
202254
```yaml
203255
Type: Uri
@@ -212,7 +264,9 @@ Accept wildcard characters: False
212264
```
213265
214266
### -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.
216270
217271
```yaml
218272
Type: PSCredential
@@ -227,8 +281,9 @@ Accept wildcard characters: False
227281
```
228282
229283
### -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.
232287
233288
```yaml
234289
Type: String[]
@@ -243,7 +298,9 @@ Accept wildcard characters: False
243298
```
244299
245300
### -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.
247304
248305
```yaml
249306
Type: String
@@ -258,7 +315,8 @@ Accept wildcard characters: False
258315
```
259316
260317
### -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.
262320
263321
```yaml
264322
Type: String[]
@@ -273,14 +331,29 @@ Accept wildcard characters: False
273331
```
274332
275333
### 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).
277338
278339
## INPUTS
279340
280341
## OUTPUTS
281342
343+
### PSGetRoleCapabilityInfo
344+
345+
The `Find-RoleCapability` cmdlet returns a **PSGetRoleCapabilityInfo** object.
346+
282347
## NOTES
283348

284349
## RELATED LINKS
285350

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

Comments
 (0)