https://github.com/badgerati/parcel
Cross-platform PowerShell package manager and provisioner
https://github.com/badgerati/parcel
cross-platform package-manager powershell provisioner provisioning
Last synced: 7 months ago
JSON representation
Cross-platform PowerShell package manager and provisioner
- Host: GitHub
- URL: https://github.com/badgerati/parcel
- Owner: Badgerati
- License: mit
- Created: 2019-09-29T16:44:10.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-10-14T18:52:35.000Z (over 6 years ago)
- Last Synced: 2025-04-09T02:11:08.340Z (10 months ago)
- Topics: cross-platform, package-manager, powershell, provisioner, provisioning
- Language: PowerShell
- Homepage:
- Size: 437 KB
- Stars: 28
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Parcel
[](https://raw.githubusercontent.com/Badgerati/Parcel/master/LICENSE.txt)
[](https://www.powershellgallery.com/packages/Parcel)
> This is still a work in progress!
Parcel is a cross-platform PowerShell package manager and provisioner for a number of different package managers.
You define a package file using YAML, and Parcel will install/uninstall the packages using the relevant provider.
## Support Providers
These are the currently support package providers (more to come!):
* Chocolatey
* PowerShell Gallery
* Scoop
* Homebrew
* Docker
* Windows Features
* Apt-get
* Yum
## Install
```powershell
Install-Module -Name Parcel
```
## Usage
You define the packages using a YAML file - the default is `parcel.yml`, but can be anything. Then, you can run one of the following:
```powershell
Install-ParcelPackages [-Path ] [-Environment ] [-IgnoreEnsures] [-WhatIf] [-Verbose]
Uninstall-ParcelPackages [-Path ] [-Environment ] [-IgnoreEnsures] [-WhatIf] [-Verbose]
```
## Examples
To install 7zip using Chocolatey, the following could be used. For each `name`/`names` and `provider` are mandatory, and the name *must* match precisely on all providers:
```yaml
---
packages:
- name: 7zip.install
provider: choco
version: 19.0
```
or to install Pester from the PowerShell Gallery:
```yaml
---
packages:
- name: pester
provider: psgallery
version: 4.8.1
```
### Properties
The properties that are currently supported are in packages are:
* name
* provider
* version (can be a specific version, or empty/latest)
* source (can be a url, or a repository name, or any other source)
* args (extra arguments to run, can also be split into `install:` and `uninstall:`)
* ensure (can be empty, or present/absent)
* os (can be windows, linux, or macos - package will only run if running on that OS)
* environment (can be anything, default is 'all'. packages will run based on `-Environment`)
* when (powershell script that returns a boolean value, if true then package will run)
* pre/post scritps (allows you to define powershell scripts to run pre/post install/uninstall)
There is also a scripts block that allows for defining pre/post scripts that run before or after all packages. They will run once at the beginning, and then once at the end.
```yaml
---
packages:
- name:
names:
provider: provider-name>
version:
source:
args:
install:
uninstall:
ensure:
os:
environment:
when:
pre:
install:
uninstall:
post:
install:
uninstall:
scripts:
pre:
install:
uninstall:
post:
install:
uninstall:
providers:
:
source:
- name:
url:
default:
args:
install:
uninstall:
```
For `when`, there is a `$parcel` object available that has the following structure:
```powershell
$parcel = @{
os = @{
type = #
name = # name of the OS, like Windows, Darwin, Ubuntu
version = # only on Windows, the version of the OS
}
environment = # set from "-Environment"
package = @{
provider = # current provider being used for current package
}
}
```
## Providers
### Chocolatey
```yaml
packages:
- name: 7zip.install
provider:
version: 19.0
```
### Scoop
```yaml
packages:
- name: 7zip
provider: scoop
version: 19.00
```
### PowerShell Gallery
```yaml
packages:
- name: Pester
provider:
version: 4.8.0
```
### Homebrew
* Self-installation is not supported due to some quirks with PowerShell
* Sources are not supported, due to Homebrew not having them
* Latest does work, but Parcel cannot retrieve the latest version as Homebrew doesn't display it
* Since Parcel can't get the latest version, using it will always "Change"
```yaml
packages:
- name: p7zip
provider:
```
> If you face issues installing casks, try running: `sudo chown -R $USER:admin /usr/local/Caskroom`
### Docker
* Self-installation is not supported - it's best to include this as another package to be installed
* Sources are not supported, due to Docker not having them (unless you pre-login to your own registry first)
```yaml
packages:
- name: badgerati/pode
provider: docker
version: 1.1.0
```
### Windows Features
* Only supported in Windows (Desktop PowerShell only)
* Version is always latest (as features have no version)
```yaml
packages:
- name: Microsoft-Hyper-V
provider:
```
### DISM
* Only supported in Windows (Desktop/Core PowerShell)
* Version is always latest
```yaml
- name: ActiveDirectory-PowerShell
provider:
```
### Apt-Get
* Self-installation is not supported - if `apt-get` is not there, Parcel will fail
* Sources are not supported
```yaml
packages:
- name: vim
provider:
version: latest
```
or:
```yaml
packages:
- name: vim
provider:
version: 2:7.4.1689-3ubuntu1.3
```
### Yum
* Self-installation is not supported - if `yum` is not there, Parcel will fail
* Sources are not supported
```yaml
packages:
- name: ansible
provider: yum
```