https://github.com/joshcorr/PSGalleryBackup
Backup and Internalize PSGallery Modules
https://github.com/joshcorr/PSGalleryBackup
Last synced: 4 months ago
JSON representation
Backup and Internalize PSGallery Modules
- Host: GitHub
- URL: https://github.com/joshcorr/PSGalleryBackup
- Owner: joshcorr
- License: mit
- Created: 2021-08-19T01:13:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-19T13:23:30.000Z (over 3 years ago)
- Last Synced: 2024-08-14T07:06:54.967Z (8 months ago)
- Language: PowerShell
- Size: 13.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - joshcorr/PSGalleryBackup - Backup and Internalize PSGallery Modules (PowerShell)
README
# PSGalleryBackup
Functions to internalize PowerShell modules as nupgk packages into a self hosted nupkg repo (Proget, nexus, etc)
This module currently supports Saving Nupkg from various feeds (remote and local), Get a list of current PowerShell packages hosted by a ProGet Feed, and Uploading desired packages to a ProGet Feed. In the future we may support Nexus and other feed types.
## Requirements
- API Token for your internal repo (Proget requires a Native API token)
- Nuget.exe on the system running Invoke-LocalPowerShellGalleryUpdate (if you intend to upload the package to an internal repo) [Install Nuget Client Tools](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools)## Scheduling up a Backup
The function `Invoke-LocalPowerShellGalleryUpdate` works to save desired PowerShell Modules and upload them to a local Proget Server. The command downloads modules based on a JSON document and the existing packages on in the repo. The JSON document should be formated in the following way:
```json
[
{
"Package_Id": "dbatools",
"Version_Text": "latest"
},
{
"Package_Id": "acltools",
"Version_Text": "latest"
},
{
"Package_Id": "PSSlack",
"Version_Text": "1.0.6"
}
]
```This can be stored next to the function, or you can store it in a web hosted source control system. The function can then be scheduled to backup desired modules and upload them to a local Proget server.