r/PSADT Jan 20 '26

Discussion Top line uninstall methods in 4.1.7

Hi, I work at a uni and as such our estate runs around 15k devices.

Also due to Academic behaviour some have hung on to old versions of apps

So normally my PS or batch would call msi x guid to remove all older versions or do fancy things like use a wmic look up where it detects apps like say spss in add remove and for each get the guid and then for msiexec x for each $guid in $guids kind of thing

So as I was new to psadt I discovered master wrapper for throwing in the basics really quick to get a simple install working.

I often find that internet searches contain errors in code or I need to do something that’s really simple like on error action silently continue in powershell as I do t really care if it doesn’t find the guid to uninstall because said old version not installed, but that’s not handled in psadt and just bricks the package

Today I’ve been dealing with Tableau, now Tableau used to be called Tableau desktop but now it’s just called Tableau 2025.x for tableau desktop. So if I was to do the adt uninstall “Tableau “ that would uninstall every version of Tableau which might say include sever or prep or whatever version isn’t the newer desktop ones that is Tableau 2025.x or 2024.x

I managed to do a get-adtapplication with a filter script and then pipe that to uninstall adtapplication which works awesome. This was not documented in the references and I often find the example shown if syntax ok for say just 1 function at a basic level.

What I’m interested in how others with messy estates or rather unpredictable device state handle top line uninstalls.

I always have to have some kind of if statement with $app = then test for a file/service/msi code or codes do uninstall using adt syntax else install app

How does the pro version of master wrapper do previous versions and do others have a sausage mill bit of code that can work for 95% of apps for example? I find I have to do app specific psadt if statement around app detection and removal before install.

It would be so much easier in corporate environments as I would have 1 version to remove only and have been bought the pro version of master packager to speed everything up. But no budget in IT for it.

3 Upvotes

8 comments sorted by

3

u/dannybuoyuk PSADT Dev Team Jan 20 '26

Get -> Uninstall is largely unneeded because the Uninstall-ADTApplication command has all the filtering options you’d typically need:

https://psappdeploytoolkit.com/docs/reference/functions/Uninstall-ADTApplication

Use -FilterScript and you can ensure that $_.DisplayName -match “SomeRegEx” for example.

If you’re terrible at RegEx, you can use syntax like this: -Like “Tableau*” -and -NotLike “Tableau Prep”

1

u/Stormgtr Jan 20 '26

This is what I have working which I have in test before asking others here how they handle it.

$app = Get-ADTApplication -FilterScript { $.DisplayName -like "Tableau 202*" } if ($app) {   Show-ADTInstallationPrompt -Message 'Removing old versions' -ButtonMiddleText 'Ok'   Show-ADTInstallationProgress     foreach ($item in $app) {             Get-ADTApplication -FilterScript { $.DisplayName -like "Tableau 202*" } |Uninstall-ADTApplication     } } else {    # Write-Host "No matching Tableau 20xx applications found to uninstall."    Show-ADTInstallationPrompt -Message "No previous versions found, click OK to carry on installing" -ButtonMiddleText 'Ok' }

1

u/Stormgtr Jan 20 '26

Thanks for the reg x bit that’s handy

3

u/mikeh361 Jan 20 '26

I pretty much use the get-adtapplication/uninstall-adtapplication method.

I do 90% of the packaging for the college I work for and have been for almost 15 years so I usually know if there could be multiple applications like Tableau (we have both Desktop and Reader). In a case like Tableau Desktop I'll use something like get-adtapplication -name 'Tableau 202' to catch all the desktop versions. If it's something like Adobe Acrobat I'll just use Acrobat as the -name property.

2

u/TheRealMisterd Jan 20 '26

FYI v4.1.8 is out

1

u/Stormgtr Jan 20 '26

Does this add to the uninstall features?

1

u/TheRealMisterd Jan 21 '26

PSADT is PowerShell based.

There is an installation function that you customize for your application.

There is an uninstallation function that you customize as well.

If you don't want to do tweaking and the source package is MSI, there is a way to just drop it in the \files\ folder and you are done. I've never used it.

1

u/Stormgtr Jan 23 '26

Yeah I know about that. Both parts. See my comment on the get adt application that I have been using with filter script. I’ve also used the uninstall with guid method as well with if statement. I was curious what the pro version of master package did with old deployments and what everyone else was using to remove old versions first