< Back

Test-ChocolateyPackageIsInstalled

Mon Jan 13, 2020 1:43 am

NAME 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.





PARAMETERS

-Name <String>

Exact name of the package to be testing against.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Version <String>

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



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Source <Object>

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



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Credential <PSCredential>

Credential used with authenticated feeds. Defaults to empty.



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-CacheLocation <String>

CacheLocation - Location for download cache, defaults to %TEMP% or value

in chocolatey.config file.



Required? false

Position? 5

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-UpdateOnly [<SwitchParameter>]

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.



Required? false

Position? named

Default value False

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





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



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Test-ChocolateyPackageIsInstalled -Name Chocolatey -Source https://chocolatey.org/api/v2















RELATED LINKS