# Download the installer
$url = "https://www.dropbox.com/PDQ13.exe?dl=1" # Put your Url with the file here..I use dropbox, you can use whatever file hosting service.
$destination = "$workdir\pdq13.exe"
# Check if Invoke-Webrequest exists otherwise execute WebClient
## Downloads latest PDQ from Company Dropbox and silently installs or updates if already installed
# Path for the workdir
$workdir = "c:\installer\"
# Check if work directory exists if not create it
If (Test-Path -Path $workdir -PathType Container)
{ Write-Host "$workdir already exists" -ForegroundColor Red}
ELSE
{ New-Item -Path $workdir -ItemType directory }
# Download the installer
$url = "https://www.dropbox.com/PDQ13.exe?dl=1" # Put your Url with the file here..I use dropbox, you can use whatever file hosting service.
$destination = "$workdir\pdq13.exe"
# Check if Invoke-Webrequest exists otherwise execute WebClient
if (Get-Command 'Invoke-Webrequest')
{
Invoke-WebRequest $url -OutFile $destination
}
else
{
$WebClient = New-Object System.Net.WebClient
$webclient.DownloadFile($url, $destination)
}
# Start the installation
Start-Process -FilePath "$workdir\PDQ13.exe" -ArgumentList "/S" # name this whatever your EXE is called
# Wait XX Seconds for the installation to finish
Start-Sleep -s 15
# Remove the installer
rm -Force $workdir\PDQ13*