![Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/733/36700733/b_36700733.jpg)
上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:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/9b1957bc-201d-4f93-8151-f572da178100.png?sign=1739676644-cXqb65mXTY97UfcMZn8q96KWNNiU3l5R-0-081070715ec19ebe4c07e62fe918c337)
- From Feeds page, click Create New Feed:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/9da2dd51-26e0-4d65-a1a7-eb844e7cd383.png?sign=1739676644-PHL2YWZglzIzhCi3aCTqLcoACgtwSFqx-0-b8b863f9e39a39168d4015e762489f98)
- A list of supported feed types is displayed. Choose PowerShell:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/0c171621-0925-4810-b984-307e7f196728.png?sign=1739676644-9G2rQTqI2mmRnJrLHTH6RMfjCw7Tg6iq-0-96f5f56a6e30e2b1167ecf4a5f9b8234)
- Enter a feed name of your choice: (for example, MyPowerShellPackages) and click the Create New PowerShell Feed button:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/3f4305f9-deb4-4008-9df5-acd528b6c5ed.png?sign=1739676644-oNCA3LbHVI8JYqtT9pJmeQEjhxmwoyAx-0-2db6dd7069f0024e58ebb47d3d0c1089)
- Review the properties of your new feed:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/49c21a5f-ef93-42be-b6f5-6dc83be5d863.png?sign=1739676644-TqlG3aV6o3P4zLDf3RQy711uWZ91KB5N-0-63685cc0688baaf56bbb17970851708f)
- 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