Using Show-InstallationPromp parameter

Hello to all,

I have built a Visual studio 2022 SSIS package and I would like to add a command that will check if Visual Studio 2019 SSIS is installed, and if so the following prompt will appear.
Where in script should I add the command that correspond to ‘Yes’ ? and where to add a command where the user press ‘No’?
I was not able to find an example for this parameter.

Thank you
Amir

Show-InstallationPrompt -Title "Uninstalling VS 2019 SSIS" -Message "The installation detected Visual studio 2019 SSIS. Would you like to uninstall this version?" -MessageAlignment 'Left' -ButtonRightText 'Yes'  -ButtonLeftText 'No' -TopMost $true

Below is a code example for you:

$response = Show-InstallationPrompt -Message '          
  
This installation will take approximately 1 hour to complete.

Do you want to continue with the installation?  

' -ButtonRightText 'No' -ButtonLeftText 'Yes'  

If ($response -eq 'No')
{
	Exit-Script -ExitCode 69002  ###This error code indicates that the user clicked "No".  
}
3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.