Below are examples on how to use PP Scripts Manager to silently install some commonly used applications. Please feel free to use and tweak the examples given below to suit your needs.
Section 1: Silently installing latest 64bit version of Firefox Extended Support Release
#Script starts here
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
# Set Download variables
$DownloadFolder = "c:\temp\apps"
$DownloadURL = "https://download.mozilla.org/?product=firefox-esr-latest&os=win64&lang=en-US"
$LocalDownloadFile = "c:\temp\apps\FFESR.EXE"
#Create temp folder if not present
$tempfolder = "C:\temp"
if (-not (Test-Path $tempfolder -PathType Container))
{
New-Item -ItemType directory -Path $tempfolder
}
# Create apps folder and turn on logging
New-Item -ItemType directory -Path $DownloadFolder
start-transcript -path "c:\temp\apps\Firefox_install.log" -append
# Download and install application
If ((Test-Path $LocalDownloadFile -PathType Leaf) -eq $False)
{
Invoke-WebRequest -Uri $DownloadURL -OutFile $LocalDownloadFile
}
c:\temp\apps\FFESR.EXE /SILENT MaintenanceService=false
#Script ends here
Section 2: Silently installing the latest 64bit version of Chrome
#Script starts here
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
# Set Download variables
$DownloadFolder = "c:\temp\apps"
$DownloadURL = "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BD32DD7BD-A4C7-9AF4-614A-F3E4D22C99F9%7D%26lang%3Den%26browser%3D3%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/chrome/install/ChromeStandaloneSetup64.exe"
$LocalDownloadFile = "c:\temp\apps\ChromeStandaloneSetup64.exe"
#Create temp folder if not present
$tempfolder = "C:\temp"
if (-not (Test-Path $tempfolder -PathType Container) )
{
New-Item -ItemType directory -Path $tempfolder
}
# Create apps folder and turn on logging
New-Item -ItemType directory -Path $DownloadFolder
start-transcript -path "c:\temp\apps\Chrome64_install.log" -append
# Download and install application
If ((Test-Path $LocalDownloadFile -PathType Leaf) -eq $False)
{
(New-Object Net.WebClient).DownloadFile($DownloadURL, "$LocalDownloadFile")
}
c:\temp\apps\ChromeStandaloneSetup64.exe /SILENT /INSTALL
#Script ends here
Section 3: Silently installing WinZip 14.5 from MSI package
#WinZip 14.5 will be coming from = http://download.winzip.com/winzip145.msi
#Script starts here
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
# Set Download variables
$DownloadFolder = "c:\temp\apps"
$DownloadURL = "http://download.winzip.com/winzip145.msi"
$LocalDownloadFile = "c:\temp\apps\winzip145.msi"
#Create temp folder if not present
$tempfolder = "C:\temp"
if (-not (Test-Path $tempfolder -PathType Container))
{
New-Item -ItemType directory -Path $tempfolder
}
# Create apps folder and enable logging
New-Item -ItemType directory -Path $DownloadFolder
start-transcript -path "c:\temp\apps\Winzip_PS.log" -append
# Download and install WinZip
If ((Test-Path $LocalDownloadFile -PathType Leaf) -eq $False)
{
Invoke-WebRequest -Uri $DownloadURL -OutFile $LocalDownloadFile
#install WinZip silently and enable verbose logging
MSIEXEC /i c:\temp\apps\winzip145.msi /qn /L*V C:\temp\apps\winzip_install.log
}
#Script ends here
Lastly, log into a computer that lives in the OU where this GPO is applied and within a couple minutes you should have ALL THREE APPLICATIONS installed. To watch the process as it is happening, and for troubleshooting logs see the “C:\Temp\Apps” folder on any computer that receives this GPO after GPUPDATE has run. If there is no Apps folder present as yet you can run GPUPDATE /FORCE from a CMD prompt to speed up the process. Chrome and Firefox will create a shortcut on the desktop by default but the WinZip 14.5 MSI does not, to verify that WinZip installed correctly you can try to launch WinZip with the following command: "C:\Program Files (x86)\WinZip\WINZIP32.EXE" from Start > Run or a CMD prompt.