-
Notifications
You must be signed in to change notification settings - Fork 1
/
chocolatey.psm1
38 lines (32 loc) · 1.13 KB
/
chocolatey.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Function Install-CommonPackages
{
<#
.SYNOPSIS
This function installs packages enumerated in configuration files.
.DESCRIPTION
This function in details:
* takes a list of packages from configuration file,
* skips packages marked as disabled,
* installs each package left,
* uses chocolatey package manager.
.PARAMETER CfgFile
Configuration file.
.LINK
https://github.com/a4099181/vagrant-provvin/blob/master/docs/Install-CommonPackages.md
.LINK
https://github.com/a4099181/vagrant-provvin/blob/master/modules/chocolatey.psm1
.LINK
https://chocolatey.org/packages
#>
Param ( [Parameter(Mandatory=$true)][String] $CfgFile )
( Get-Content $CfgFile | ConvertFrom-Json ).chocolatey.packages |
Where-Object { -Not $_.disabled } |
ForEach-Object {
if ( $_.version ) {
cinst --no-progress --limit-output --allow-empty-checksums -y $_.id --version $_.version
}
else {
cinst --no-progress --limit-output --allow-empty-checksums -y $_.id
}
}
}