Second path fragment must not be a drive or UNC name. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). \install-local.ps1īut now, I’m getting the error at the bottom of this message.Ĭ:\Users\my_user\Desktop\local_choco\\legalīy installing, you accept licenses for the packages. Set-ExecutionPolicy Bypass -Scope Process -Force. Install-LocalChocoPackage “C:\Users\my_user\Desktop\local_choco\” I tried saving your script into a filed called: “install-local.ps1”. Secondly, how about an example on how to use this? I’m a newbie in PowerShell. Write-Verbose -Message "choco install -y $($package.FullName)" $Packages = Get-ChildItem -Path $PackageSource Write-Verbose -Message "Current package: $PackageName" 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. As a reminder, here is our internal folder structure of the packages we need to generate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |