How can I have powershell run the silent uninstall first, wait until it is finished, and then run the install? After researching I did as below, which works, but the blank Notepad window pops up and I had to close it.
I don't want the user to get any notepad window when I deploy this to them, simply uninstall and then install.
Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -eq "On-Screen Takeoff"} | foreach-
object -process {$_.Uninstall()}
Notepad.exe | Out-Null
$arguments="/quiet"
Start-Process "\\davisconstruction.com\ROOT\Installs\OnCenter\OST\Testverion3906\ost3906.msi" $arguments