

$UninstallXML = (Start-Process "$executable" -ArgumentList $VisioPro2016Uninstall -Wait -Passthru).ExitCode

$VisioPro2016Uninstall = "Uninstalling Microsoft Visio Professional 2016." $ConfigFileName = "VisPro2016MSconfig.xml" $ConfigFile = $scriptRoot + "\VisPro2016MSconfig.xml" $location = "C:\Program Files\Common Files\microsoft shared\ClickToRun" $configFileLocation = "C:\Program Files\Common Files\microsoft shared\ClickToRun" $location = "C:\Program Files\Common Files\microsoft shared\OFFICE16\Office Setup Controller" $configFileLocation = "C:\Program Files\Common Files\microsoft shared\OFFICE16\Office Setup Controller" $ConfigFile = $scriptRoot + "\VisPro2016config.xml" $location = "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE16\Office Setup Controller" $configFileLocation = "C:\Program Files (x86)\Common Files\microsoft shared\OFFICE16\Office Setup Controller"

It works for all other methods and the rest of the script passes in parameters to the function when called fine. I am trying to uninstall an Installation of Visio Professional 2016, installed with the click-to-run method.
