Uninstall ALL MS Visio versions (and MS Project in comments)

It’s in the comment of this same post.

Yeah I saw it but its Pasted weird and looks like some of it was cut off was hoping someone had the PS1 that they know is working and make available to download.

I fixed the post to make the code look like code.
try it again.

Great script!

But for version 2007 it also requires XML removal approach.
Path to exe is: C:\Program Files\Common Files\Microsoft Shared\OFFICE12\Office Setup Controller\setup.exe

And for 2003 it’s better to handle ProductCode as array of returned object’s fields as it might return few of them and some are null.
if ($ProjPro2003) {
foreach ($code in $ProjPro2003) {
if ($code -like “{*”) {
Execute-MSI -Action Uninstall -Path $code.trim()
}
}
}