-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
It would be nice if the Install-MSI function could support a 3-part asynch model. The reason is, if i "stop" a powershell script execution while it is running an MSI, the MSI runs to completion (taking several minutes) and i would like it to cancel/rollback the MSI, it also gives me more control of when to start the MSI progress bar and potentially nest it under other progress bars.
Example cmdlets:
- Start-MSIInstall
Starts the installer and returns a context object - Watch-MSIInstall
Monitors the installer using the context object and displays progress bars, etc - Stop-MSIInstall
Stops/cancels the install
Example desired code:
try {
$MSIObject = Start-MSIInstall $InstallPath
$MSIObject | Watch-MSIInstall -ParentProgressID $MyProgressID
} catch {
#do some thing
} finally {
#ensure MSI is not still running
if ($MSIObject.IsRunning) {
$MSIObject | Stop-MSIInstall
}
}
Reactions are currently unavailable