-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathInstall-AdobeReaderDC-Choco.ps1
More file actions
29 lines (24 loc) · 1.07 KB
/
Install-AdobeReaderDC-Choco.ps1
File metadata and controls
29 lines (24 loc) · 1.07 KB
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
$ChocoPackage = "adobereader"
$Params = '"/NoUpdates"'
# Check if Chocolatey is installed and if not, install it.
If ( get-command -Name choco.exe -ErrorAction SilentlyContinue ){
$ChocoExe = "choco.exe"
} elseif (test-path -Path (Join-Path -path $Env:ALLUSERSPROFILE -ChildPath "Chocolatey\bin\choco.exe")) {
$ChocoExe = Join-Path -path $Env:ALLUSERSPROFILE -ChildPath "Chocolatey\bin\choco.exe"
} else {
try {
write-output "Starting to install chocolatey...."
Invoke-Expression ((New-Object -TypeName net.webclient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
choco feature enable -n allowGlobalConfirmation
$ChocoExe = Join-Path -path $Env:ALLUSERSPROFILE -ChildPath "Chocolatey\bin\choco.exe"
}
catch {
Throw "Failed to install Chocolatey"
}
}
If ($ChocoExe){
start-process -FilePath $ChocoExe -ArgumentList "upgrade $ChocoPackage --force --confirm --install-if-not-installed -params $Params" -Wait
} else {
throw 'Could not find choco.exe'
Exit 666
}