I think there's a hard coded base path somewhere in the scripte when using the UpdateLocation parameter. So when I'm using a different then the default path C:\SP\SP2019 in the very end of the process this happens:
Set-Content : Could not find a part of the path 'C:\SP\2019\_UPDATE_HISTORY.txt'.
At P:\SP-Test\AutoSPSourceBuilder\AutoSPSourceBuilder.ps1:1083 char:5
+ Set-Content -Path "$Destination\$textFileName" -Value "This media ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\SP\2019\_UPDATE_HISTORY.txt:String) [Set-Content], DirectoryNotFoundExcep
tion
+ FullyQualifiedErrorId : GetContentWriterDirectoryNotFoundError,Microsoft.PowerShell.Commands.SetContentCommand
Add-Content : Could not find a part of the path 'C:\SP\2019\_UPDATE_HISTORY.txt'.
At P:\SP-Test\AutoSPSourceBuilder\AutoSPSourceBuilder.ps1:1085 char:1
+ Add-Content -Path "$Destination\$textFileName" -Value "-------------- ...