上QQ阅读APP看书,第一时间看更新
How to do it...
- Once you have installed ProGet using either the GUI or PowerShell script approach, log in to the ProGet application home page using the default admin account until you create a username and password:
- From Feeds page, click Create New Feed:
- A list of supported feed types is displayed. Choose PowerShell:
- Enter a feed name of your choice: (for example, MyPowerShellPackages) and click the Create New PowerShell Feed button:
- Review the properties of your new feed:
- Open the PowerShell ISE or console, and register your new repository:
$RepositoryURL = `
"http://localhost:81/nuget/MyPowerShellPackages/"
Register-PSRepository -Name MyPowerShellPackages `
-SourceLocation $RepositoryURL`
-PublishLocation $RepositoryURL `
-InstallationPolicy Trusted
- Publish a module you already have installed (Pester, for example):
Publish-Module -Name Pester -Repository MyPowerShellPackages `
-NuGetApiKey "Admin:Admin"
- Download a module from PSGallery, save it to the C:\Foo folder, and publish to your new repository (for example, Carbon):
Find-Module -Name Carbon -Repository PSGallery
New-Item -ItemType Directory -Path 'C:\Foo'
Save-Module -Name Carbon -Path C:\foo
Publish-Module -Path C:\Foo\Carbon `
-Repository MyPowerShellPackages `
-NuGetApiKey "Admin:Admin"
- Find all the modules available in your newly created and updated repository:
Find-Module -Repository MyPowerShellPackages