Skip to content

Test-ChocolateyPackageIsInstalled

SYNOPSIS

Verify if a Chocolatey Package is installed locally

SYNTAX

Test-ChocolateyPackageIsInstalled [-Name] <String> [[-Version] <String>] [[-Source] <Object>]
 [[-Credential] <PSCredential>] [[-CacheLocation] <String>] [-UpdateOnly] [<CommonParameters>]

DESCRIPTION

Search and compare the Installed PackageName locally, and compare the provided property. The command return an object with the detailed properties, and a comparison between the installed version and the expected version.

EXAMPLES

EXAMPLE 1

Test-ChocolateyPackageIsInstalled -Name Chocolatey -Source https://chocolatey.org/api/v2

PARAMETERS

-Name

Exact name of the package to be testing against.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Version

Version expected of the package, or latest to compare against the latest version from a source.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Source

Source to compare the latest version against. It will retrieve the

Type: System.Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Credential

Credential used with authenticated feeds. Defaults to empty.

Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CacheLocation

CacheLocation - Location for download cache, defaults to %TEMP% or value in chocolatey.config file.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-UpdateOnly

Test if the package needs to be installed if absent. In Update Only mode, a package of lower version needs to be updated, but a package absent won't be installed.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

https://github.com/chocolatey/choco/wiki/CommandsList

Back to top