| external help file | PSModule-help.xml |
|---|---|
| Locale | en-US |
| Module Name | PowerShellGet |
| ms.date | 10/04/2021 |
| online version | https://learn.microsoft.com/powershell/module/powershellget/find-script?view=powershellget-1.x&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Find-Script |
Finds a script.
Find-Script [[-Name] <String[]>] [-MinimumVersion <Version>] [-MaximumVersion <Version>]
[-RequiredVersion <Version>] [-AllVersions] [-IncludeDependencies] [-Filter <String>]
[-Tag <String[]>] [-Includes <String[]>] [-Command <String[]>] [-Proxy <Uri>]
[-ProxyCredential <PSCredential>] [-Repository <String[]>] [-Credential <PSCredential>]
[<CommonParameters>]
The Find-Script cmdlet finds a specified script in registered repositories.
Find-ScriptThis command finds all available scripts.
Find-Script -Name "Start-WFContosoServer"This command find the script named Start-WFContosoServer.
Find-Script -Name "Required-Script2" -RequiredVersion 2.0 -Repository "LocalRepo01"This command finds a script by name and required version in the LocalRepo01 repository.
Find-Script -Name "Required-Script2" -RequiredVersion 2.0 -Repository "LocalRepo1" | Format-List * -ForceThis command finds Required-Script2 in the LocalRepo1 repository, and then passes the resulting
PSRepositoryItemInfo object to the Format-List cmdlet.
Find-Script -Name "Required-Script2" -MinimumVersion 2.1 -MaximumVersion 2.5 -Repository "LocalRepo1"
Version Name Type Repository Description
------- ---- ---- ---------- -----------
2.5 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
This command finds all versions of RequiredScript2 between versions 2.1 and 2.5 in the LocalRepo1 respository.
Find-Script -Name "Required-Script02" -AllVersionsVersion Name Type Repository Description
------- ---- ---- ---------- -----------
1.0 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
1.5 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
2.0 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
2.5 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
This command finds all versions of Required-Script02.
Find-Script -Name "Script-WithDependencies1" -IncludeDependencies -Repository "LocalRepo1"Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.0 Script-WithDependencies1 Script LocalRepo1 Description for the Script-WithDependencies1 script
2.0 RequiredModule3 Script LocalRepo1 RequiredModule3 module
2.5 Required-Script1 Script LocalRepo1 Description for the Required-Script1 script
2.5 Required-Script2 Script LocalRepo1 Description for the Required-Script2 script
This command finds a script and its dependencies.
Find-Script -Tag "Tag1" -Repository "LocalRepo1"Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.0 Fabrikam-ClientScript Script LocalRepo1 Description for the Fabrikam-ClientScript script
This command finds scripts that have the tag Tag1 in the LocalRepo1 repository
Find-Script -Command Test-FunctionFromScript_Required-Script3 -Repository "LocalRepo1"Version Name Type Repository Description
------- ---- ---- ---------- -----------
2.5 Required-Script3 Script LocalRepo1 Description for the Required-Script3 script
This command finds a script that contains the specified command name.
Find-Script -Includes "Workflow" -Repository "LocalRepo1"Version Name Type Repository Description
------- ---- ---- ---------- -----------
2.5 Fabrikam-ClientScript Script LocalRepo1 Description for the Fabrikam-ClientScript script
1.0 Fabrikam-Script Script LocalRepo1 Description for the Fabrikam-Script script
This command finds workflow scripts in the LocalRepo1 repository.
Find-Script -Name "Required-Script*" -Repository "LocalRepo1"
Version Name Type Repository Description
------- ---- ---- ---------- -----------
2.5 Required-Script1 Script local1 Description for the Required-Script1 script
2.5 Required-Script2 Script local1 Description for the Required-Script2 script
2.5 Required-Script3 Script local1 Description for the Required-Script3 scriptThis command uses the wildcard character (*) to find scripts that begin with Required-Script.
Indicates that this operation finds all script versions.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies an array of commands to find in scripts. A command can be a function or workflow.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseType: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseFinds scripts based on the PackageManagement provider-specific search syntax.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates that this operation gets all scripts that are dependent upon the script specified in the Name parameter.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies type of script to get. The acceptable values for this parameter are:
FunctionWorkflow
Type: System.String[]
Parameter Sets: (All)
Aliases:
Accepted values: Function, Workflow
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the maximum, or newest, version of the script to find. The MaximumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
Type: System.Version
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the minimum version of the script to find. The MinimumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
Type: System.Version
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies an array of names of scripts to find.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: TrueSpecifies a proxy server for the request, rather than connecting directly to the Internet resource.
Type: System.Uri
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies a user account that has permission to use the proxy server that is specified by the Proxy parameter.
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the friendly name of a repository that has been registered by running
Register-PSRepository.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the exact version number of the script to find.
Type: System.Version
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies an array of tags.
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Important
As of April 2020, the PowerShell Gallery no longer supports Transport Layer Security (TLS) versions 1.0 and 1.1. If you are not using TLS 1.2 or higher, you will receive an error when trying to access the PowerShell Gallery. Use the following command to ensure you are using TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
For more information, see the announcement in the PowerShell blog.