Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Test Package

Paul Broadwith edited this page Jun 27, 2017 · 1 revision

Test-Package

NAME

Test-Package

SYNOPSIS

Test Chocolatey package

SYNTAX

Test-Package [[-Nu] <Object>] [-Install] [-Uninstall] [[-Parameters] <String>] [[-Vagrant] <String>] [-VagrantOpen] [-VagrantNoClear] 
[<CommonParameters>]

DESCRIPTION

The function can test install, uninistall or both and provide package parameters during test.
It will force install and then remove the Chocolatey package if called without arguments.

It accepts either nupkg or nuspec path. If none specified, current directory will be searched
for any of them.

PARAMETERS

-Nu <Object>
    If file, path to the .nupkg or .nuspec file for the package.
    If directory, latest .nupkg or .nuspec file wil be looked in it.
    If ommited current directory will be used.
    
    Required?                    false
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-Install [<SwitchParameter>]
    Test chocolateyInstall.ps1 only.
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-Uninstall [<SwitchParameter>]
    Test chocolateyUninstall.ps1 only.
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-Parameters <String>
    Package parameters
    
    Required?                    false
    Position?                    2
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-Vagrant <String>
    Path to chocolatey-test-environment: https://github.com/majkinetor/chocolatey-test-environment
    
    Required?                    false
    Position?                    3
    Default value                $Env:au_Vagrant
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-VagrantOpen [<SwitchParameter>]
    Open new shell window
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
-VagrantNoClear [<SwitchParameter>]
    Do not remove existing packages from vagrant package directory
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    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 (http://go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS

OUTPUTS

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

PS C:\>Test-Package -Install

Test the install of the package from the current directory.

RELATED LINKS

https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package

NOTE: This documentation has been automatically generated from Get-Help Test-Package -Full.