다음을 통해 공유


Find-PSResource

이름 또는 기타 패키지 속성에 따라 리포지토리(로컬 또는 원격)에서 패키지를 검색합니다.

Syntax

Find-PSResource
    [[-Name] <String[]>]
    [-Type <ResourceType>]
    [-Version <String>]
    [-Prerelease]
    [-Tag <String[]>]
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [-IncludeDependencies]
    [<CommonParameters>]
Find-PSResource
    [-Prerelease]
    -CommandName <String[]>
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]
Find-PSResource
    [-Prerelease]
    -DscResourceName <String[]>
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [<CommonParameters>]

Description

cmdlet은 Find-PSResource 이름 또는 기타 패키지 속성에 따라 리포지토리(로컬 또는 원격)에서 패키지를 검색합니다.

예제

예 1

이 예제에서는 PowerShell 갤러리 PowerShellGet 패키지를 검색합니다. cmdlet은 가장 높은 시험판이 아닌 버전을 반환합니다.

Find-PSResource -Name PowerShellGet -Repository PSGallery

Name          Version Prerelease Repository Description
----          ------- ---------- ---------- -----------
PowerShellGet 2.2.5              PSGallery  PowerShell module with commands for discovering, installing, updating and p…

예 2

이 예제에서는 시험판 버전을 포함하여 PowerShellGet 패키지에 대한 PowerShell 갤러리 검색합니다.

Find-PSResource -Name PowerShellGet -Repository PSGallery -Prerelease

Name          Version Prerelease Repository Description
----          ------- ---------- ---------- -----------
PowerShellGet 3.0.21  beta21     PSGallery  PowerShell module with commands for discovering, installing, updating and p…

예제 3

이 예제에서는 PowerShell 갤러리 검색하여 Microsoft.PowerShell.SecretManagement 패키지를 검색합니다. cmdlet은 지정된 버전 범위를 충족하는 모든 버전을 반환합니다.

$parameters = @{
    Name = 'Microsoft.PowerShell.SecretManagement'
    Version = '(0.9.0.0, 1.2.0.0]'
    Repository = 'PSGallery'
    Prerelease = $true
}
Find-PSResource @parameters

Name                                  Version Prerelease Repository Description
----                                  ------- ---------- ---------- -----------
Microsoft.PowerShell.SecretManagement 1.1.2              PSGallery  …
Microsoft.PowerShell.SecretManagement 1.1.1              PSGallery  …
Microsoft.PowerShell.SecretManagement 1.1.0   preview2   PSGallery  …
Microsoft.PowerShell.SecretManagement 1.1.0   preview    PSGallery  …
Microsoft.PowerShell.SecretManagement 1.1.0              PSGallery  …
Microsoft.PowerShell.SecretManagement 1.0.1              PSGallery  …
Microsoft.PowerShell.SecretManagement 1.0.0              PSGallery  …
Microsoft.PowerShell.SecretManagement 0.9.1              PSGallery  …

예제 4

이 예제에서는 의 Get-TargetResourceCommandName을 포함하는 모든 모듈 리소스를 검색합니다. cmdlet은 명령을 포함하는 모든 모듈 리소스를 반환합니다.

Find-PSResource -CommandName Get-TargetResource -Repository PSGallery

Name                 Package Name               Version
----                 ------------               -------
{Get-TargetResource} cRegFile                   1.2
{Get-TargetResource} cVNIC                      1.0.0.0
{Get-TargetResource} cWindowsErrorReporting     1.1
{Get-TargetResource} OctopusDSC                 4.0.1131
{Get-TargetResource} supVsts                    1.1.17.0
{Get-TargetResource} SystemLocaleDsc            1.2.0.0
{Get-TargetResource} WindowsDefender            1.0.0.4
{Get-TargetResource} xInternetExplorerHomePage  1.0.0
{Get-TargetResource} xPowerShellExecutionPolicy 3.1.0.0

예제 5

이 예제에서는 DSC 리소스 를 포함하는 모든 모듈 리소스 SystemLocale를 검색합니다.

Find-PSResource -DscResourceName SystemLocale -Repository PSGallery

Name           Package Name          Version
----           ------------          -------
{SystemLocale} ComputerManagementDsc 9.0.0
{SystemLocale} SystemLocaleDsc       1.2.0.0

예제 6

이 예제에서는 등록된 모든 PSResourceRepositories에서 로 시작하는 이름의 리소스를 Computer검색합니다.

Find-PSResource -Name Computer*

Name                                              Version Prerelease Repository Description
----                                              ------- ---------- ---------- -----------
ComputerManagementDsc                             9.0.0              PSGallery  DSC resources for configuration of a Wi…
ComputerManagement                                1.1.2.3            PSGallery  A PowerShell module for working with th…
ComputerCleanup                                   1.2.0              PSGallery  Module for freeing up disk space / remo…
Computer_UnjoinDomainAndJoinWorkgroup_Config      1.0.0              PSGallery  This example switches the computer 'Ser…
Computer_SetComputerDescriptionInWorkgroup_Config 1.0.0              PSGallery  This example will set the computer desc…
Computer_RenameComputerInWorkgroup_Config         1.0.0              PSGallery  This example will set the machine name …
Computer_RenameComputerInDomain_Config            1.0.0              PSGallery  This example will change the machines n…
Computer_RenameComputerAndSetWorkgroup_Config     1.0.0              PSGallery  This configuration will set the compute…
Computer_JoinDomainSpecifyingDC_Config            1.0.0              PSGallery  This configuration sets the machine nam…
Computer_JoinDomain_Config                        1.0.0              PSGallery  This configuration sets the machine nam…

예제 7

이 예제에서는 태그로 모듈을 찾는 방법을 보여 줍니다. 값은 CrescendoBuiltMicrosoft.PowerShell.Crescendo 모듈을 사용하여 만든 모듈에 자동으로 추가되는 태그입니다.

Find-PSResource -Tag CrescendoBuilt

Name            Version Prerelease Repository Description
----            ------- ---------- ---------- -----------
AptPackage      0.0.2              PSGallery  PowerShell Crescendo-generated Module to query APT-Package Information
Cobalt          0.4.0              PSGallery  A PowerShell Crescendo wrapper for WinGet
Croze           0.0.5              PSGallery  A PowerShell Crescendo wrapper for Homebrew
Foil            0.3.0              PSGallery  A PowerShell Crescendo wrapper for Chocolatey
Image2Text      1.0.2              PSGallery  PowerShell Images into ASCII art
pastel          1.0.1              PSGallery  PowerShell commands for pastel
PSDupes         0.0.1              PSGallery  A crescendo module to locate duplicate files. Very fast and easy to use, …
psFilesCli      0.0.3              PSGallery  A PowerShell wrapper for files-cli.exe
PSLogParser     0.0.2              PSGallery  Crescendo Powershell module for Log Parser 2.2
Quser.Crescendo 0.1.3              PSGallery  This module displays session information of users logged onto a local or …
RoboCopy        1.0.1              PSGallery  PowerShell cmdlet for the official RoboCopy.exe
SpeedTest-CLI   1.0.1              PSGallery  PowerShell cmdlets for Internet Speed Test
SpeedTestCLI    1.0.0              PSGallery  PowerShell cmdlets speedtest-cli
SysInternals    1.1.0              PSGallery  PowerShell cmdlets for SysInternal tools
Takeown         1.0.2              PSGallery  Crescendo Powershell wrapper of takeown.exe
TShark          1.0.2              PSGallery  PowerShell cmdlet for tshark.exe
VssAdmin        0.8.0              PSGallery  This is a Crescendo module to wrap the Windows `vssadmin.exe` command-lin…

매개 변수

-CommandName

검색할 명령의 이름입니다.

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Credential

리포지토리에 액세스할 때 사용할 선택적 자격 증명입니다.

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DscResourceName

검색할 DSC 리소스의 이름입니다.

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IncludeDependencies

지정된 경우 검색은 일치하는 모든 리소스의 종속성을 반환합니다. 종속성은 중복 제거됩니다.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

찾을 리소스의 이름입니다. 와일드카드는 지원되지만 NuGet은 문자만 허용합니다 * . NuGet은 로컬(파일 기반) 리포지토리의 와일드카드 검색을 지원하지 않습니다.

Type:String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-Prerelease

지정된 경우 반환된 검색 결과에 시험판 버전이 포함됩니다.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Repository

검색할 리포지토리 이름을 하나 이상 지정합니다. 지정하지 않으면 패키지가 포함된 리포지토리가 발견될 때까지 검색에 등록된 모든 리포지토리가 우선 순위 순서(가장 높은 우선 순위)로 포함됩니다. 리포지토리는 우선 순위별로 정렬된 다음 이름별로 정렬됩니다. 우선 순위 값이 낮을수록 우선 순위가 높습니다.

여러 리포지토리에서 리소스를 검색할 때 PSResourceGet cmdlet은 이 정렬 순서를 사용하여 리포지토리를 검색합니다. Find-PSResource 는 정렬된 리포지토리 목록에서 일치하는 모든 패키지를 반환합니다.

매개 변수는 와일드카드 문자를 지원합니다 * . 여러 리포지토리를 지정하는 경우 모든 이름은 와일드카드 문자를 포함하거나 생략해야 합니다. 와일드카드를 사용 및 사용하지 않고는 이름의 혼합을 지정할 수 없습니다.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-Tag

지정된 태그를 포함하는 리소스에 대한 검색 결과를 필터링합니다. 여러 태그를 지정하면 cmdlet은 제공된 모든 태그를 포함하는 리소스만 반환합니다.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Type

찾을 하나 이상의 리소스 유형을 지정합니다. 지원되는 리소스 종류는 다음과 같습니다.

  • None
  • Module
  • Script
Type:Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceType
Accepted values:None, Module, Script
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Version

반환할 리소스의 버전을 지정합니다. 값은 NuGet 버전 관리 구문을 사용하여 정확한 버전 또는 버전 범위일 수 있습니다.

와일드카드는 지원되지만 NuGet은 와일드카드 문자 *만 허용합니다. NuGet 버전 범위에 대한 자세한 내용은 패키지 버전 관리를 참조하세요.

PowerShellGet은 NuGet 버전 범위 설명서에 나열된 최소 포괄 버전을 제외한 모든 버전을 지원합니다. 을 버전으로 사용하면 1.0.0.0 버전 1.0.0.0 이상(최소 포함 범위)이 생성되지 않습니다. 대신 값은 필수 버전으로 간주됩니다. 최소 포함 범위를 검색하려면 를 버전 범위로 사용합니다 [1.0.0.0, ] .

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

입력

String[]

출력

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSCommandResourceInfo

참고

모듈은 에 fdres 대한 Find-PSResource별칭으로 를 정의합니다.