Test A Deployment Outside of PDQ Deploy (with PowerShell)

Purpose:

You wish to check to ensure deployments work outside of the PDQ Deploy program. This can be useful in troubleshooting a myriad of possible issues.

Requirements:

In order to perform this test, the following prerequisites are required:

1. Download the package you need to test from the PDQ Deploy Package Library. In this example, we are using the Zoom Client package, because the package is a single install step, but this troubleshooting can be performed with the Install Step of most packages. 
01-ZoomPackageDownload.jpg
2. 
PowerShell (WMF) 4.0+ on both the PDQ console and the target must be installed. 
3. PS Remoting must be enabled on the Target Computer. Open an elevated PowerShell prompt on the Target Computer and run the following command: 

Enable-PSRemoting -Force

4.  The user context from which you are running the PowerShell ISE on the PDQ server must have permissions to install software on the target machine. It must also be able to write to the ADMIN$ of the target.

Resolution:

1. While logged into your PDQ server as your Deploy User search for PowerShell ISE, right-click, and "Run as administrator". 
00.png
2. Copy this script into the PowerShell ISE on your PDQ server and make the necessary edits, highlighted in the screenshots below. 

#Requires -RunAsAdministrator
$ErrorActionPreference = "SilentlyContinue"
#Define your target machine#
$Target = "TARGET COMPUTER HOSTNAME"
#Define the source of your exe, by default PDQ uses C:\Users\Public\Documents\Admin Arsenal\Repository#

$Source = "C:\Users\Public\Documents\Admin Arsenal\PDQ Deploy\Repository\Zoom\Zoom Client\5.8.1.1435\ZoomInstallerFull.msi"
$Destination = "\\$Target\ADMIN$\AdminArsenal"
$Credentials = Get-Credential

Copy-Item -Path "$Source" -Destination "$Destination" -Force
Invoke-Command -ComputerName $Target -Credential $Credentials -ScriptBlock {
Set-Location "$Env:windir\AdminArsenal";
msiexec.exe /i "ZoomInstallerFull.msi" ALLUSERS=1 /qn /norestart /log output.log MSIRESTARTMANAGERCONTROL=”Disable”
}

3. Change the variables $Target and $Source, and replace the entire msiexec.exe command with the Command Line from the package that is being tested in the ISE:
02-EditingTheScript.jpg

03-PackageCommandLine2.jpg

4. Press F5 to run the script (the ISE is the active window).

5. You will be prompted for credentials when running the script. Enter your Deploy User credentials here. 

6. This will perform the following (this can take several minutes):

  • Copy over the package installation file to \\$Target\ADMIN$\AdminArsenal\
  • Run the installer using the configured Command Line from the package being tested
  • Generate an Output Log in \\$Target\ADMIN$\AdminArsenal\output.log detailing the test results

7. Check the target machine to ensure that the application was installed.

If you need to uninstall the application after the test, follow this guide:

Uninstalling software based on the program name 

See Also:

Article - Uninstalling software based on the program name 
Article - Create A Zero-Impact Package To Test Deployments & Schedules

Was this article helpful?
Still have a question or want to share what you have learned? Visit our Community Discord to get help and collaborate with others.