
In my environment write access to the root of the C: Drive is restricted.
As a result the script is unable to write to the directed location, so logging fails.
I suggest we replace "C:\Autopilot_Import_GUI_Log.txt" on line 520 with "$env:TEMP\Autopilot_Import_GUI_log.txt" to log to the users TEMP folder.