Remove-MSIApplications for multiple applications

Hello
Thanks for reading my post
I am new to this so thank you for taking the time to help me out
I have been asked to remove Java from our environment, but we must keep Java versions Java 6 Update 22 and Java 7 Update 55.

The good news is that part of my script is working - see below
Remove-MSIApplications -Name ‘Java’ -ExcludeFromUninstall (‘DisplayName’, ‘Java 7 Update 55’, ‘Contains’), (‘DisplayName’, ‘Java 6™ Update 22’, ‘Contains’)

This does not install Java 7 Update 55 (as expected) but it uninstalls Java 6 22

I have done a bit of research and found the below
Remove-MSIApplications -Name “Java*” -Wildcard -ExcludeFromUninstall @(,
(‘DisplayName’,‘Java™ 6 Update 22’,‘Exact’),
(‘DisplayName’,‘Java 7 Update 55’,‘Exact’))

Sadly this removes all Java from my system, I now seem to be going around in circles :frowning:

how do you go about keeping two applications?

any help would be wonderful

You are nearly there…
Have a look at Example 4 here in the reference (It may answer what you are doing wrong):

1 Like