< Back

Find-RoleCapability

Wed Jan 30, 2019 5:57 pm

NAME Find-RoleCapability



SYNOPSIS

Finds role capabilities in modules.





SYNTAX

Find-RoleCapability [[-Name] <String[]>] [-AllVersions] [-Filter <String>] [-MaximumVersion <Version>] [-MinimumVersion <Version>] [-ModuleName

<String>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Repository <String[]>] [-RequiredVersion <Version>] [-Tag <String[]>] [<CommonParameters>]





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 a PSGetRoleCapabilityInfo 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 [<SwitchParameter>]

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 <String>

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 <Version>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MinimumVersion <Version>

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 <String>

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 <String[]>

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 <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ProxyCredential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Repository <String[]>

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 <Version>

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 <String[]>

Specifies an array of tags.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This 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 to pass 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 to pass 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