This is a part of an on-going blog series written by Adam Gordon. Each week, Adam will walk you through a PowerShell command, showing you when and how to use each one. This week, Adam covers Find-RoleCapability.
When to use Find-RoleCapability
The Find-RoleCapability cmdlet searches registered repositories to find PowerShell role capabilities and modules.
For each role capability found by Find-RoleCapability, a PSGetRoleCapabilityInfo object is returned.
PSGetRoleCapabilityInfo objects can be sent down the pipeline to the Install-Module or Save-Module cmdlets.
PowerShell role capabilities define which commands and applications are available to a user at a Just Enough Administration (JEA) endpoint.
Role capabilities are defined by files with a .psrc extension.
How to use Find-RoleCapability
Find role capabilities:
Find-RoleCapability finds role capabilities in each registered repository.
To search a specific repository, use the –Repository parameter.
Find and install a role capability’s module:
Find-RoleCapability -Name General-Lev1 | Install-Module -Verbose
Find-RoleCapability uses the –Name parameter to specify the General-Lev1 role capability.
The object is sent down the pipeline. Install-Module uses the –Verbose parameter to display status messages during the installation.
After the install is finished, you can use the Get-InstalledModule output to confirm that the JeaExamples module was installed.
Learn last week’s command: Find-Module.
Need PowerShell training? Check out ITProTV’s PowerShell online IT training courses.