Find-PSResource
Egy (helyi vagy távoli) adattárból származó csomagokat keres név vagy más csomagtulajdonságok alapján.
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
A Find-PSResource
parancsmag egy (helyi vagy távoli) adattárból keres egy csomagot egy név vagy más csomagtulajdonság alapján.
Példák
1\. példa
Ez a példa a PowerShellGet-csomag PowerShell-galéria keres. A parancsmag a legmagasabb, nem előzetes verziót adja vissza.
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\. példa
Ez a példa PowerShell-galéria keres a PowerShellGet-csomagban, beleértve az előzetes verziókat is.
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\. példa
Ez a példa a Microsoft.PowerShell.SecretManagement csomag PowerShell-galéria keres. A parancsmag az összes olyan verziót visszaadja, amely megfelel a megadott Verziótartománynak .
$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\. példa
Ez a példa az összes modulerőforrást megkeresi, amely tartalmazza a CommandName tulajdonságát Get-TargetResource
. A parancsmag visszaadja az összes modulerőforrást, amely tartalmazza a parancsot.
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\. példa
Ez a példa a DSC-erőforrást SystemLocale
tartalmazó összes modulerőforrást keresi.
Find-PSResource -DscResourceName SystemLocale -Repository PSGallery
Name Package Name Version
---- ------------ -------
{SystemLocale} ComputerManagementDsc 9.0.0
{SystemLocale} SystemLocaleDsc 1.2.0.0
6\. példa
Ez a példa az összes regisztrált PSResourceRepositories erőforrásban keres olyan erőforrásokat, amelyek neve a következővel Computer
kezdődik: .
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. példa
Ez a példa bemutatja, hogyan kereshet modulokat címke alapján. Az CrescendoBuilt
érték egy olyan címke, amely automatikusan hozzáadódik a Microsoft.PowerShell.Crescendo modullal létrehozott modulokhoz.
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…
Paraméterek
-CommandName
A keresendő parancs neve.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Credential
Nem kötelező hitelesítő adatok, amelyeket az adattárak elérésekor kell használni.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DscResourceName
A keresendő DSC-erőforrás neve.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeDependencies
Ha meg van adva, a keresés visszaadja az összes egyező erőforrást a függőségeikhez. A függőségek deduplikáltak.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
A keresendő erőforrás neve. A helyettesítő karakterek támogatottak, de a NuGet csak a karaktert *
fogadja el. A NuGet nem támogatja a helyi (fájlalapú) adattárak helyettesítő karakteres kereséseit.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | True |
-Prerelease
Ha meg van adva, előzetes verziókat is tartalmaz a visszaadott keresési eredményekben.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Repository
Egy vagy több keresendő adattárnevet ad meg. Ha nincs megadva, a keresés az összes regisztrált adattárat prioritási sorrendben (elsőként a legmagasabb) tartalmazza, amíg meg nem találja a csomagot tartalmazó adattárat. Az adattárak prioritás, majd név szerint vannak rendezve. Az alacsonyabb prioritású értékek elsőbbséget élveznek.
Ha több adattárban keres erőforrásokat, a PSResourceGet-parancsmagok ezzel a rendezési sorrendben keresik az adattárakat. Find-PSResource
az összes egyező csomagot visszaadja az adattárak rendezett listájából.
A paraméter támogatja a *
helyettesítő karaktert. Ha több adattárat ad meg, az összes névnek tartalmaznia kell a helyettesítő karaktert, vagy el kell kihagynia azt. Helyettesítő karakterekkel és anélkül nem adhatja meg a nevek kombinációját.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | True |
-Tag
Szűri a megadott címkéket tartalmazó erőforrások keresési eredményeit. Ha több címke van megadva, a parancsmag csak az összes megadott címkét tartalmazó erőforrásokat adja vissza.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Type
Egy vagy több keresendő erőforrástípust határoz meg. A támogatott erőforrástípusok a következők:
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
A visszaadni kívánt erőforrás verzióját adja meg. Az érték lehet pontos verzió vagy verziótartomány a NuGet verziószámozási szintaxisával.
A helyettesítő karakterek támogatottak, de a NuGet csak helyettesítő karaktert *
fogad el. További információ a NuGet-verziótartományokról: Csomagverzió-készítés.
A PowerShellGet a NuGet-verziótartomány dokumentációjában felsorolt minimális befogadó verzión kívül az összeset támogatja. A verzióként való használat 1.0.0.0
nem eredményez 1.0.0.0-s vagy újabb verziót (minimális befogadó tartomány). Ehelyett a rendszer a szükséges verziónak tekinti az értéket. A minimális befogadó tartomány kereséséhez használja [1.0.0.0, ]
a verziótartományt.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Bevitelek
String[]
Kimenetek
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSCommandResourceInfo
Jegyzetek
A modul aliasként definiálja fdres
a következőt: Find-PSResource
.
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: