NAME
Find-RoleCapability
SYNOPSIS
Finds role capabilities in modules.SYNTAX
Find-RoleCapability [[-Name]
] [-AllVersions] [-Filter ] [-MaximumVersion ] [-MinimumVersion
] [-ModuleName ] [-Proxy ] [-ProxyCredential ] [-Repository
] [-RequiredVersion ] [-Tag ] [ ] DESCRIPTION
The Find-RoleCapability cmdlet finds PowerShell role capabilities in modules. Find-RoleCapability searches modules
in registered repositories. For each role capability that this cmdlet finds, it returns a PSGetRoleCapabilityInfo object. You can pass aPSGetRoleCapabilityInfo object to the Install-Module cmdlet to install the module that contains the role
capability. PowerShell role capabilities define which commands, applications, and so on are available to a user at a Just Enough Administration (JEA) endpoint. Role capabilities are defined by files with a .psrc extension.PARAMETERS
-AllVersions [
Indicates that this cmdlet gets all versions of a module. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -Filter
Finds modules based on the PackageManagement provider-specific search syntax. For NuGet, this is the
equivalent of using the search bar on the PowerShell Gallery website. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-MaximumVersion
@{Text=} Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-MinimumVersion
Specifies the minimum version of the module to include in results. The MinimumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-ModuleName
Specifies the name of the module in which to search for role capabilities. The default is all modules. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-Name
Specifies an array of names of role capabilities to search for. Required? false Position? 0 Default value None Accept pipeline input? False Accept wildcard characters? false-Proxy
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-ProxyCredential
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Repository
Specifies an array of registered repositories in which to search. The default is all repositories. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-RequiredVersion
Specifies the version of the module to include in the results. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-Tag
Specifies an array of tags. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? falseThis cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
OUTPUTS
NOTES
Example 1: Find all role capabilities
PS C:\>Find-RoleCapability
Name Version ModuleName Repository
---- ------- ---------- ----------
Maintenance 1.0 Demo_Module PSGallery MyJeaRole 0.0.3 MyJeaModule PSGallery MyRoleCap 0.2.0.6 MyRoleCapabilityModule PSGallery This command finds all role capabilities.Example 2: Find role capabilities by name
PS C:\>Find-RoleCapability -Name "Maintenance,MyJeaRole"
Name Version ModuleName Repository
---- ------- ---------- ----------
Maintenance 1.0 Demo_Module PSGallery MyJeaRole 0.0.3 MyJeaModule PSGallery This command finds the role capabilities named Maintenance and MyJeaRole.Example 3: Find role capabilities and save them
PS C:\>Find-RoleCapability -Name "Maintenance,MyJeaRole" | Save-Module -Path "C:\MyModulesPath"
PS C:\> Get-ChildItem -Path "C:\MyModulesPath"
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/18/2015 11:46 PM Demo_Module
d----- 10/29/2015 6:32 PM MyJeaModule
The first command finds the role capabilities named Maintenance and MyJeaRole, and uses the pipeline operator topass them to Save-Module, which saves the modules that contain the role capabilities to a local folder.
The second command uses Get-ChildItem to get the items saved with the prior command.
Example 4: Find role capabilities and install them
PS C:\>Find-RoleCapability -Name "Maintenance,MyJeaRole" | Install-Module
PS C:\> Get-InstalledModule
Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.0 Demo_Module Module PSGallery JEA RoleCapabilities 0.0.3 MyJeaModule Module PSGallery MyJeaModule description The first command finds the role capabilities named Maintenance and MyJeaRole, and uses the pipeline operator topass them to Install-Module, which installs the modules.
The second command gets the installed modules.RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=822321