How to test PSADT uninstall

I am still learning PSADT. So far I have done installations in the install block inside the PowerShell script.

Now I need to add an uninstall command. Once I do, if I run the Deploy-Application.exe again, is it smart enough to run the uninstall command because it detects that the application is installed?

Is there some special command to run in Command Prompt to only test the uninstall like Deploy-Applicaiton.exe -uninstall

You should probably look in the Examples folders in the PSADT v3.10.1 download.

They have lots of sample files to choose from.

1 Like

I will do that. Thank you

I always use Powershell ISE as admin to test the install and uninstall. ONce your install is finished find this section
Param (
[Parameter(Mandatory = $false)]
[ValidateSet(‘Install’, ‘Uninstall’, ‘Repair’)]
[String]$DeploymentType = ‘Install’,
[Parameter(Mandatory = $false)]
[ValidateSet(‘Interactive’, ‘Silent’, ‘NonInteractive’)]
[String]$DeployMode = ‘Interactive’,
[Parameter(Mandatory = $false)]
[switch]$AllowRebootPassThru = $false,
[Parameter(Mandatory = $false)]
[switch]$TerminalServerMode = $false,
[Parameter(Mandatory = $false)]
[switch]$DisableLogging = $false

and change [String]$DeploymentType = ‘Install’ to ‘Uninstall’ and then run the script again.