The psadtv4 template provides the code required to package a PSAppDeployToolkit v4 application as a Chocolatey package.
The v4 templates need some information from the user when building a package from the template. Required information is:
- PackageVersion: The version for the Chocolatey package, recommended to be the version number from the installer.
- Title: The title for the package. This is a slightly more descriptive name for the package in addition to the package id.
- Organization: Your organization name.
You can use this template directly via Chocolatey, however you will need to copy the PSAppDeployToolkit application folder and its contents to the Chocolatey package's tools directory prior to packing and publishing the package to your repository for use.
choco new <packageid> --template='psadtv4' --version='<package version>' Title='<Software title>' Organization='<Your org>'You can use the ConvertTo-ChocolateyPackage.ps1 script in this repository to convert your PSADT app to a Chocolatey package.
Notes:
- The package id is automatically set the the folder name of the PSAppDeployToolkit application. Use
-Idto override. - The output directory of the Chocolatey package defaults to the current working directory. Use `-OutputDirectory to override.
- Use
-CompilePackageto create the package nupkg file automatically. Otherwise, you will need to runchoco packagainst the package nuspec once you are ready.
$templateArguments = @{
PackageVersion = '<package version>'
Title = '<software title>'
Organization = '<organization name>'
}
. .\ConvertTo-ChocolateyPackage -PSADTPath '<PSADT App path>' -Template psadtv4 -TemplateArgs $templateArguments