Find-Module
리포지토리에서 지정된 조건과 일치하는 모듈을 찾습니다.
Syntax
Find-Module
[[-Name] <string[]>]
[-MinimumVersion <version>]
[-MaximumVersion <version>]
[-RequiredVersion <version>]
[-AllVersions]
[-IncludeDependencies]
[-Filter <string>]
[-Tag <string[]>]
[-Includes <string[]>]
[-DscResource <string[]>]
[-Command <string[]>]
[-Repository <string[]>]
[<CommonParameters>]
Description
cmdlet은 Find-Module
지정된 조건과 일치하는 리포지토리에서 모듈을 찾습니다.
Find-Module
는 찾은 각 모듈에 대해 PSRepositoryItemInfo 개체를 반환합니다. 개체는 파이프라인 아래로 와 같은 cmdlet으로 Install-Module
보낼 수 있습니다.
리포지토리를 처음 Find-Module
사용하려고 하면 업데이트를 설치하라는 메시지가 표시될 수 있습니다.
리포지토리 원본이 cmdlet에 Register-PSRepository
등록되지 않은 경우 오류가 반환됩니다.
Find-Module
는 버전을 제한하는 매개 변수가 사용되지 않는 경우 모듈의 최신 버전을 반환합니다. 리포지토리의 모듈 버전 목록을 얻으려면 AllVersions 매개 변수를 사용합니다.
MinimumVersion 매개 변수가 지정된 Find-Module
경우 는 최소값과 같거나 더 큰 모듈의 버전을 반환합니다. 리포지토리에서 사용할 수 있는 최신 버전이 있는 경우 최신 버전이 반환됩니다.
MaximumVersion 매개 변수가 지정된 Find-Module
경우 는 지정된 버전을 초과하지 않는 최신 버전의 모듈을 반환합니다.
RequiredVersion 매개 변수를 지정 Find-Module
한 경우 지정된 버전과 정확히 일치하는 모듈 버전만 반환합니다. Find-Module
는 원본 간에 이름이 충돌할 수 있으므로 사용 가능한 모든 모듈을 검색합니다.
다음 예제에서는 PowerShell 갤러리 유일하게 등록된 리포지토리로 사용합니다. Get-PSRepository
는 등록된 리포지토리를 표시합니다. 등록된 리포지토리가 여러 대 있는 경우 매개 변수를 -Repository
사용하여 리포지토리의 이름을 지정합니다.
예제
예제 1: 이름으로 모듈 찾기
이 예제에서는 기본 리포지토리에서 모듈을 찾습니다.
Find-Module -Name PowerShellGet
Version Name Repository Description
------- ---- ---------- -----------
2.1.0 PowerShellGet PSGallery PowerShell module with commands for discovering...
cmdlet은 Find-Module
Name 매개 변수를 사용하여 PowerShellGet 모듈을 지정합니다.
예제 2: 비슷한 이름의 모듈 찾기
이 예제에서는 별표(*
) 와일드카드를 사용하여 비슷한 이름의 모듈을 찾습니다.
Find-Module -Name PowerShell*
Version Name Repository Description
------- ---- ---------- -----------
0.4.0 powershell-yaml PSGallery Powershell module for serializing and...
2.1.0 PowerShellGet PSGallery PowerShell module with commands for...
1.9 Powershell.Helper.Extension PSGallery # Powershell.Helper.Extension...
3.1 PowerShellHumanizer PSGallery PowerShell Humanizer wraps Humanizer...
4.0 PowerShellISEModule PSGallery a module that adds capability to the ISE
cmdlet은 Find-Module
별표(*
) 와일드카드와 함께 Name 매개 변수를 사용하여 PowerShell을 포함하는 모든 모듈을 찾습니다.
예제 3: 최소 버전별 모듈 찾기
이 예제에서는 모듈의 최소 버전을 검색합니다. 리포지토리에 최신 버전의 모듈이 포함되어 있으면 최신 버전이 반환됩니다.
Find-Module -Name PowerShellGet -MinimumVersion 1.6.5
Version Name Repository Description
------- ---- ---------- -----------
2.1.0 PowerShellGet PSGallery PowerShell module with commands for discovering...
cmdlet은 Find-Module
Name 매개 변수를 사용하여 PowerShellGet 모듈을 지정합니다. MinimumVersion은 버전 1.6.5를 지정합니다. Find-Module
는 최소 버전을 초과하고 최신 버전이므로 PowerShellGet 버전 2.1.0 을 반환합니다.
예제 4: 특정 버전별 모듈 찾기
이 예제에서는 모듈의 특정 버전을 나타내는 개체를 반환합니다. 지정된 버전을 찾을 수 없으면 오류가 반환됩니다.
Find-Module -Name PowerShellGet -RequiredVersion 1.6.5
Version Name Repository Description
------- ---- ---------- -----------
1.6.5 PowerShellGet PSGallery PowerShell module with commands for discovering...
cmdlet은 Find-Module
Name 매개 변수를 사용하여 PowerShellGet 모듈을 지정합니다. RequiredVersion 매개 변수는 버전 1.6.5를 지정합니다.
예제 5: 특정 리포지토리에서 모듈 찾기
이 예제에서는 리포지토리 매개 변수를 사용하여 특정 리포지토리에서 모듈을 찾습니다.
Find-Module -Name PowerShellGet -Repository PSGallery
Version Name Repository Description
------- ---- ---------- -----------
2.1.0 PowerShellGet PSGallery PowerShell module with commands for discovering...
cmdlet은 Find-Module
Name 매개 변수를 사용하여 PowerShellGet 모듈을 지정합니다. 리포지토리 매개 변수는 PSGallery 리포지토리를 검색하도록 지정합니다.
예제 6: 여러 리포지토리에서 모듈 찾기
이 예제에서는 를 Register-PSRepository
사용하여 리포지토리를 지정합니다. Find-Module
는 리포지토리를 사용하여 모듈을 검색합니다.
Register-PSRepository -Name MySource -SourceLocation https://www.myget.org/F/powershellgetdemo/
Find-Module -Name Contoso* -Repository PSGallery, MySource
Repository Version Name Description
---------- ------- ---- -----------
PSGallery 2.0.0.0 ContosoServer Cmdlets and DSC resources for managing Contoso Server...
MySource 1.2.0.0 ContosoClient Cmdlets and DSC resources for managing Contoso Client...
cmdlet은 Register-PSRepository
새 리포지토리를 등록합니다. Name 매개 변수는 MySource라는 이름을 할당합니다. SourceLocation 매개 변수는 리포지토리의 주소를 지정합니다.
cmdlet은 Find-Module
별표(*
) 와일드카드와 함께 Name 매개 변수를 사용하여 Contoso 모듈을 지정합니다. 리포지토리 매개 변수는 PSGallery 및 MySource의 두 리포지토리를 검색하도록 지정합니다.
예제 7: DSC 리소스가 포함된 모듈 찾기
이 명령은 DSC 리소스를 포함하는 모듈을 반환합니다. Includes 매개 변수에는 리포지토리를 검색하는 데 사용되는 네 가지 미리 정의된 기능이 있습니다. Tab-complete를 사용하여 Includes 매개 변수에서 지원하는 네 개의 기능을 표시합니다.
Find-Module -Repository PSGallery -Includes DscResource
Version Name Repository Description
------- ---- ---------- -----------
2.7.0 Carbon PSGallery Carbon is a PowerShell module...
8.5.0.0 xPSDesiredStateConfiguration PSGallery The xPSDesiredStateConfiguration module...
1.3.1 PackageManagement PSGallery PackageManagement (a.k.a. OneGet) is...
2.7.0.0 xWindowsUpdate PSGallery Module with DSC Resources...
3.2.0.0 xCertificate PSGallery This module includes DSC resources...
3.1.0.0 xPowerShellExecutionPolicy PSGallery This DSC resource can change the user...
cmdlet은 Find-Module
리포지토리 매개 변수를 사용하여 리포지토리 PSGallery를 검색합니다.
Includes 매개 변수는 리포지토리에서 매개 변수가 검색할 수 있는 기능인 DscResource를 지정합니다.
예제 8: 필터를 사용하여 모듈 찾기
이 예제에서는 모듈을 찾기 위해 필터를 사용하여 리포지토리를 검색합니다.
NuGet 기반 리포지토리의 경우 Filter 매개 변수는 인수에 대한 이름, 설명 및 태그를 검색합니다.
Find-Module -Filter AppDomain
Version Name Repository Description
------- ---- ---------- -----------
1.0.0.0 AppDomainConfig PSGallery Manipulate AppDomain configuration...
1.1.0 ClassExplorer PSGallery Quickly search the AppDomain for classes...
cmdlet은 Find-Module
Filter 매개 변수를 사용하여 AppDomain에 대한 리포지토리를 검색합니다.
매개 변수
-AllVersions
결과에 모듈의 모든 버전을 포함하도록 지정합니다. MinimumVersion, MaximumVersion 또는 RequiredVersion 매개 변수에는 AllVersions 매개 변수를 사용할 수 없습니다.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Command
모듈에서 찾을 명령의 배열을 지정합니다. 명령은 함수 또는 워크플로일 수 있습니다.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DscResource
DSC 리소스를 포함하는 모듈의 이름 또는 이름 일부를 지정합니다. PowerShell 규칙에 따라 는 여러 인수를 제공할 때 OR 검색을 수행합니다.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Filter
PackageManagement 공급자별 검색 구문을 기반으로 필터를 지정합니다. NuGet 모듈의 경우 이 매개 변수는 PowerShell 갤러리 웹 사이트의 Search 표시줄을 사용하여 검색하는 것과 같습니다.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeDependencies
이 작업에 Name 매개 변수에 지정된 모듈에 종속된 모든 모듈이 포함되어 있음을 나타냅니다.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Includes
특정 종류의 PowerShell 기능을 포함하는 모듈만 반환합니다. 예를 들어 DSCResource를 포함하는 모듈만 찾을 수 있습니다. 이 매개 변수에 허용되는 값은 다음과 같습니다.
- Cmdlet
- DscResource
- 함수
- RoleCapability
Type: | String[] |
Accepted values: | Cmdlet, DscResource, Function, RoleCapability |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaximumVersion
검색 결과에 포함할 모듈의 최대 또는 최신 버전을 지정합니다. MaximumVersion 및 RequiredVersion은 동일한 명령에서 사용할 수 없습니다.
Type: | Version |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MinimumVersion
결과에 포함할 모듈의 최소 버전을 지정합니다. MinimumVersion 및 RequiredVersion은 동일한 명령에서 사용할 수 없습니다.
Type: | Version |
Aliases: | Version |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
리포지토리에서 검색할 모듈의 이름을 지정합니다. 모듈 이름의 쉼표로 구분된 목록이 허용됩니다. 와일드카드가 허용됩니다.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | True |
-Repository
리포지토리 매개 변수를 사용하여 모듈을 검색할 리포지토리를 지정합니다. 여러 리포지토리가 등록될 때 사용됩니다. 쉼표로 구분된 리포지토리 목록을 허용합니다. 리포지토리를 등록하려면 를 사용합니다 Register-PSRepository
. 등록된 리포지토리를 표시하려면 를 사용합니다 Get-PSRepository
.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequiredVersion
결과에 포함할 모듈의 정확한 버전 번호를 지정합니다. RequiredVersion은MinimumVersion 또는 MaximumVersion과 동일한 명령에서 사용할 수 없습니다.
Type: | Version |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tag
태그 배열을 지정합니다. 예제 태그에는 DesiredStateConfiguration, DSC, DSCResourceKit 또는 PSModule이 포함됩니다.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
출력
PSRepositoryItemInfo
Find-Module
는 파이프라인 아래로 보낼 수 있는 PSRepositoryItemInfo 개체를 와 같은 cmdlet으로 Install-Module
만듭니다.
참고
이 cmdlet은 Windows 7 또는 Windows 2008 R2 이상 릴리스에서 Windows PowerShell PowerShell 5.0 이상 릴리스에서 실행됩니다.