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
I always use Powershell ISE as admin to test the install and uninstall. ONce your install is finished find this section
[CmdletBinding()]
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.