How does your PowerShell script launch the installer program? Does the script wait for the installer to complete before ending?
Running a sequence install->uninstall->install for the same installer on a remote VM
Hi, I wrote a python program that calls a Powershell script with popen. The Powershell script invokes a command on a remote windows virtual machine.
I have a sequence of commands installing a product, then uninstalling it, and when I want to install it it tells me that it is already installed. But if I put a sleep (5) between uninstall and the second install, it works perfectly. Everything runs on a windows virtual machine.
This sleep works for products that install / uninstall few files, but if I have larger products this sleep (5) is no longer useful. How can I make it wait until all the files are uninstalled so I can install it again? Thanks
2 answers
Sort by: Most helpful
-
-
MyHi 21 Reputation points
2021-02-12T16:59:42.71+00:00 In Powershell script, I use Invoke-Command to launch the installer and I already set WaitForExit. And as I said, I install the product, all good. I uninstall it, and then I want to install it again, but it tells me that it is already installed, everything happening in a for loop. I have a list of commands. [Install installer1.exe, uninstall installer1.exe, install installer.exe, ....]