Hi, I hope you all have been well. I have been working within PSADT, but after numerous attempts to try and understand what’s going on, I believe I’m against a wall. What I am trying to accomplish is to test the path to a registrykey exists, and on $true it executes and uninstall. This doesn’t seem to do anything and it doesn’t fail, it simply runs and tells me it’s complete without making a change.
{ if (!(Test-Path -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{BFBFDCC1-7657-4ED9-B5DE-F83AD449FDF}'))
{ Execute-MSI -Action Uninstall -Path '{BFBFDCC1-7657-4ED9-B5DE-F83AD449FDF}' -Parameters '/qn /norestart'} }
{ if (!(Test-Path -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC3A8B99-F329-4128-87D9-BAA344426467}'))
{ Execute-MSI -Action Uninstall -Path '{AC3A8B99-F329-4128-87D9-BAA344426467}' -Parameters '/qn /norestart'} }
Thank you for any. I thought I was in the right direction with a test-path, but I must be missing something.
I wasn’t sure where to exactly post my question.