Currently working with PSADT and trying to customize the log file name generated by the Start-ADTMsiProcess function via PSAppDeployToolkit.Extensions.psm1 File. I want the MSI log file to follow a custom naming convention as “$MyVariable_[MSI_MSIFileName]_DeploymentType.log”
log file is controlled internally via the $LogFileName variable inside Start-ADTMsiProcess and I have tried to update the same in PSAppDeployToolkit.Extensions.psm1 but it is providing below error message:
”Cannot write to function Start-ADTMsiProcess because it is read-only or constant.”
along with some other error as :
”Cannot retrieve the dynamic parameters for the cmdlet. The variable ‘$Script:CommandTable’ cannot be retrieved because it has not been set.”
Note: Tried value for $LogFileName = @{$false=[IO.Path]::GetFileNameWithoutExtension($MyVariable_)+“_[MSI_”+[IO.Path]::GetFileNameWithoutExtension($FilePath)+“]”;$true=‘’}[$logName -eq ‘’. Same was working with PSADTv3 version.
Can anyone guide what I am missing over here?