- Now, Don't Get Confused...
- Setting Up Package Repositories
- Using the Microsoft PowerShell Gallery
- Installing and Uninstalling Packages
- Creating and Using a Private Repository
Creating and Using a Private Repository
We’ve established that it’s probably not a good idea to trust public repositories. The security requirements of your organization may in fact prevent you from downloading software from Chocolatey. Thus, I’ll close this tutorial by giving you an overview of hosting your own private, internal package source, which you’ll mark as trusted.
As this blog post teaches, 1 you have two basic ways to host your own OneGet repo:
- On-premises NuGet server
- Azure-based MyGet feed
Once you have your on- or off-premises NuGet server up and running, register the repo on all computers that will access it:
Register-PackageSource -Name ’myRep’ -Location ’https://mycompany/nuget/myprovider’ –ProviderName ’myprovider’ -Trust
Did you notice the -Trust parameter? You can apply trust to a repo after it’s been registered. For instance, just for grins I’ll trust my Chocolatey provider:
Get-PackageSource -ProviderName chocolatey | Set-PackageSource -Trusted Name ProviderName IsTrusted IsRegistered IsValidated Location ---- ------------ --------- ------------ ----------- -------- chocolatey Chocolatey True True True http://ch...