-
Notifications
You must be signed in to change notification settings - Fork 58
/
Chocolatey PS Module.ps1
42 lines (37 loc) · 1.26 KB
/
Chocolatey PS Module.ps1
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
39
40
41
42
<#Author : Dean Cefola
# Creation Date: 02-23-2021
# Usage : PS Gallery / Chocolatey Setup
#********************************************************************************
# Date Version Changes
#------------------------------------------------------------------------
# 02/23/2021 1.0 Initial Version
#
#*********************************************************************************
#
#>
####################################
# Check PSGallery Repository #
####################################
$PSRepo = Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue
if ($PSRepo -eq $false){
write-host 'Add PSGallery Repository'
Register-PSRepository -Default
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose
}
else {
write-host 'Set PSGallery Repository as Trusted'
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose
}
############################
# Install Chocolatey #
############################
Install-Module `
-Name chocolatey `
-RequiredVersion 0.0.71 `
-Force `
-AllowClobber `
-AllowPrerelease `
-Repository PSGallery `
-AcceptLicense `
-Verbose
Import-Module -Name chocolatey