Update App Install Scripts/App - Adobe Acrobat 32bit - Install.ps1
This commit is contained in:
@@ -1,62 +1,69 @@
|
|||||||
<#
|
<#
|
||||||
Author: Gabe Kerntke
|
Author: Gabe Kerntke
|
||||||
Company: UFS LLC
|
Company: UFS LLC
|
||||||
Date: 07-16-2025
|
Date: 07-16-2025
|
||||||
|
|
||||||
.Synopsis
|
.Synopsis
|
||||||
Script to install Adobe Acrobat 64bit
|
Script to install Adobe Acrobat 64bit
|
||||||
|
|
||||||
.Modified
|
.Modified
|
||||||
2025-07-16 (GabeK) - Original script created
|
2025-07-16 (GabeK) - Original script created
|
||||||
#>
|
#>
|
||||||
|
|
||||||
# Variables #
|
[CmdletBinding()]
|
||||||
|
Param(
|
||||||
$App_Name = "Adobe Acrobat"
|
[Parameter(Mandatory = $false)]
|
||||||
$File_Name_Prefix = "Adobe-Acrobat-x32"
|
$App_Name = "Adobe Acrobat",
|
||||||
$File_Name_Extension = "zip"
|
[Parameter(Mandatory = $false)]
|
||||||
$Install_Parameters = "/sAll /rd"
|
$File_Name_Prefix = "Adobe-Acrobat-x32",
|
||||||
$EPCache_Folder = "3rd Party Patches\$App_Name"
|
[Parameter(Mandatory = $false)]
|
||||||
$File_Name = "$File_Name_Prefix.$File_Name_Extension"
|
$File_Name_Extension = "zip",
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
# Define a script block that contains the Invoke-WebRequest command
|
$Install_Parameters = "/sAll /rd",
|
||||||
$scriptBlock = {
|
[Parameter(Mandatory = $false)]
|
||||||
(Invoke-WebRequest -UseBasicParsing -Headers @{
|
$EPCache_Folder = "3rd Party Patches\$App_Name",
|
||||||
"accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
|
[Parameter(Mandatory = $false)]
|
||||||
"accept-encoding" = "gzip, deflate, br"
|
$File_Name = "$File_Name_Prefix.$File_Name_Extension"
|
||||||
"accept-language" = "en-GB,en;q=0.9,en-US;q=0.8"
|
)
|
||||||
} -Uri "https://helpx.adobe.com/acrobat/kb/acrobat-dc-downloads.html").Links.href -like "*Acrobat_DC_Web_WWMUI.zip"| Select-Object -First 1
|
|
||||||
}
|
# Define a script block that contains the Invoke-WebRequest command
|
||||||
#Start a new PowerShell background job and pass the script block to it
|
$scriptBlock = {
|
||||||
$job = Start-Job -ScriptBlock $scriptBlock
|
(Invoke-WebRequest -UseBasicParsing -Headers @{
|
||||||
|
"accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
|
||||||
#Wait for the job to complete
|
"accept-encoding" = "gzip, deflate, br"
|
||||||
$timeout = 30
|
"accept-language" = "en-GB,en;q=0.9,en-US;q=0.8"
|
||||||
Wait-Job $job -timeout $timeout | Out-Null
|
} -Uri "https://helpx.adobe.com/acrobat/kb/acrobat-dc-downloads.html").Links.href -like "*Acrobat_DC_Web_WWMUI.zip"| Select-Object -First 1
|
||||||
|
}
|
||||||
#Get the output from the job and display it
|
#Start a new PowerShell background job and pass the script block to it
|
||||||
$output = Receive-Job $job
|
$job = Start-Job -ScriptBlock $scriptBlock
|
||||||
$DownloadURL = $output
|
|
||||||
|
#Wait for the job to complete
|
||||||
# Script start #
|
$timeout = 30
|
||||||
|
Wait-Job $job -timeout $timeout | Out-Null
|
||||||
Invoke-WebRequest -UseBasicParsing "https://endpoint.ufsdata.com/download/repository/632809041/Functions.ps1" -outfile "$Env:windir\NCentral\Cache\Functions.ps1"
|
|
||||||
. "C:\Windows\NCentral\Cache\Functions.ps1"
|
#Get the output from the job and display it
|
||||||
|
$output = Receive-Job $job
|
||||||
#Check to see if program is installed
|
$DownloadURL = $output
|
||||||
$Applist = Get-Software | Sort-Object -Descending
|
|
||||||
|
#Region Script Start
|
||||||
If ($Applist.DisplayName -eq "$App_Name") {
|
If ((Test-Path "C:\Temp\Script Cache") -eq $False) { New-Item -ItemType directory -Path "C:\Temp\Script Cache" }
|
||||||
#Get currently installed version
|
Invoke-WebRequest -UseBasicParsing "https://scripts.gabesville.com/Gabesville/Powershell-Scripts/raw/branch/main/Functions%20Scripts/Functions.ps1" -outfile "C:\Temp\Script Cache\Functions.ps1"
|
||||||
$Local_Version = Get-Software | Where-Object { $_.DisplayName -like "*$App_Name*" } | Select-Object -ExpandProperty DisplayVersion
|
. "C:\Temp\Script Cache\Functions.ps1"
|
||||||
Write-Host "$App_Name already installed. (Installed version: $Local_Version)"
|
|
||||||
}
|
#Check to see if program is installed
|
||||||
|
$Applist = Get-Software | Sort-Object -Descending
|
||||||
Else {
|
|
||||||
Test-Probe_Online
|
If ($Applist.DisplayName -eq "$App_Name") {
|
||||||
Expand-Archive $EPCacheLocalLocation -DestinationPath "C:\Windows\NCentral\Cache" -Force
|
#Get currently installed version
|
||||||
Remove-Item $EPCacheLocalLocation -Force
|
$Local_Version = Get-Software | Where-Object { $_.DisplayName -like "*$App_Name*" } | Select-Object -ExpandProperty DisplayVersion
|
||||||
$EPCacheLocalLocation = "C:\WINDOWS\NCentral\Cache\Adobe Acrobat\setup.exe"
|
Write-Host "$App_Name already installed. (Installed version: $Local_Version)"
|
||||||
Install-App
|
}
|
||||||
}
|
|
||||||
# Script End #
|
Else {
|
||||||
|
Test-Probe_Online
|
||||||
|
Expand-Archive $EPCacheLocalLocation -DestinationPath "C:\Windows\NCentral\Cache" -Force
|
||||||
|
Remove-Item $EPCacheLocalLocation -Force
|
||||||
|
$EPCacheLocalLocation = "C:\WINDOWS\NCentral\Cache\Adobe Acrobat\setup.exe"
|
||||||
|
Install-App
|
||||||
|
}
|
||||||
|
#Region Script End
|
||||||
Reference in New Issue
Block a user