But for some reason it isn’t happy with what I have specified as its erroring with directory name invalid for /log="$configToolkitLogDir\Install.txt"
I have played around with the quotes but still complains about the path not being found.
If i hardcode the path it has no issues, any help would be appreciated
You’re misunderstanding the use of $configToolkitLogDir. You instead want to configure Toolkit_LogPath by opening AppDeployToolkitConfig.xml and set Toolkit_LogPath to your desired path for logfiles (eg, C:\Temp). Then in your Deploy-Application.ps1, just specify the log’s file name. No need for the full path.
Similarly, you don’t need to specify $dirFiles, either. As long as your setup files are in the Files directory, you can get away with not including $dirFIles. It’s only when your setup files are in subdirectories of Files that you need to specify $dirfiles. (eg, Execute-Process “$dirFIles\bin\setup.exe”)
Note that I tweaked your double quotes (you had a mix of straight and curly quotes) and removed some single quotes (not needed for such things as -Window Style). Perhaps that was just a result of copy/paste into your question, but the particular quotes you use can bite you in the ass.