Execute-MSI Log path change

So this means we must modify AppDeployToolkitMain.ps1 and AppDeployToolkitConfig.xml to get what you want.

Step 1: In AppDeployToolkitConfig.xml add the path where you want the uninstall log files to go in a new XML entry:

<Toolkit_UNLogPath>C:\PSADT_Uninstall</Toolkit_UNLogPath>|

.
Step 2:In AppDeployToolkitMain.ps1 add code to read this new XML entry if we are uninstalling.
below this line:

[string]$configToolkitLogDir = $ExecutionContext.InvokeCommand.ExpandString($xmlToolkitOptions.Toolkit_LogPath)

add:

If ($deploymentType -ieq 'Uninstall') {
	[string]$configToolkitLogDir = $ExecutionContext.InvokeCommand.ExpandString($xmlToolkitOptions.Toolkit_UNLogPath)
}

The catch: You will now have a customized version of PSADT. Everytime a new version of PSADT is released, you will have to insert these changes. I use WinMerge from 2013 to sync up my 150+ changes. You have only 2.

1 Like