How to show closing/defer prompt to user

Users are telling me in my environment that users are not seeing any prompts for closing application on the machine but application closes on itself and starts installation.

This is the code which I am executing on user’s machine.

While running this manually it do not show me any error but while running from sccm, users are complaining that it did not prompt me to close application before installing.

Please check and correct me if anything wrong here.

[string]$installPhase = ‘Pre-Installation’

	## Prompt the user to close the following applications if they are running:
    Show-InstallationWelcome -CloseApps 'chrome' -BlockExecution -AllowDeferCloseApps -DeferTimes 3 -PersistPrompt
    	
    # Show Progress Message (with the default message)
    ##Show-InstallationProgress
    # Remove any previous versions of Google
      Remove-msiapplications -Name 'Google Chrome' -Exact  
     Execute-Process -Path 'RemoveAll.bat' -CreateNoWindow 'true'

	
	##*===============================================
	##* INSTALLATION
	##*===============================================
	[string]$installPhase = 'Installation'
	
	# Install the base MSI and apply a transform

      Execute-MSI -Action Install -Path 'GoogleChromeStandaloneEnterprise64.msi' -Transform 'Chromev80.Mst'

i think you should set to execute only when user logged on and check “allow user interaction”

Remove this line Execute-Process -Path ‘RemoveAll.bat’ -CreateNoWindow ‘true’
Because it is not necessary, chrome remove / update itself.