
The OutputPath is the location where we want to output our NuGet packages to.Ĭompiled nupkg contents include chocolateyInstallĪfter we have generated our internal NuGet Packages, we can use the following PowerShell function to install them. The SourcePath parameter is the root path of our package(s). This PowerShell function takes two parameters: SourcePath and OutputPath. Write-Verbose -Message 'Successfully built Chocolatey packages' Write-Warning -Message "Failed to build Chocolatey package for $pkg" Write-Verbose -Message "Trying to build NuGet package for $pkg"Ĭhoco pack -outputdirectory "$OutputPath" -use-system-powershell $pkgs = Get-ChildItem -Directory $srcPath Write-Verbose -Message "Creating $OutputPath" Write-Verbose -Message 'Building local Chocolatey packages' [CmdletBinding(DefaultParameterSetName = 'Parameter Set 1', Now that we understand the basics of our nuspec packages, we now need to call our New-LocalChocoPackage.ps1 script that will loop through a directory of packages and generate new NuGet package (nupkg) files. Under each package name, we have a nuspec XML file and a subfolder called tools that contains our chocolateyInstall.ps1 file. We have a top-level Packages folder followed by our package name.


nupkg! That said, it's awesome the main request is already available.As a reminder, here is our internal folder structure of the packages we need to generate. YES: It would be terrific if they could update this to install simply with the file path to a. (of course you could have already been in a local folder, so if you were in Tools: `-add-source. Let's say you had that file living at: "C:\Code\Tools\Botsay\microsoft.botsay.1.0.0.nupkg": to install this as a global tool:ĭotnet tool install -g -add-source C:\Code\Tools\Botsay microsoft.botsay you can then move that nupkg file anywhere, including on another computer. nupkg file ( microsoft.botsay.1.0.0.nupkg). So using their tutorial, if you follow the steps to make the simple little project and finally package the project to produce a.

nupkg file, you HAVE to provide the path to a directory in the first argument, meaning MUST be a directory, and then a name, which MUST repeat the nupkg name (without version, so for microsoft.botsay.1.0.0.nupkg name is microsoft.botsay). To add to what others have said: Unfortunately this can't just specify a path to a.
