How to create log file with Execute-MSI command

//How to create log file with Execute-MSI command
How to create log file with Execute-MSI command2017-12-20T14:40:31+00:00

The Toolkit Forums General How to create log file with Execute-MSI command

  • Author
  • Gordo
    Post count: 11

    Okay, I’m stumped. I’ve tried this about a couple dozen different ways and can’t get a log file to generate. It does if I run the MSI install from a regular command line, but not via the PowerShell toolkit.

    Execute-MSI -Action 'Install' -Path "$InstallPath\DRAInstaller.msi" -Transform 'DRA.mst' -Parameters "ADDLOCAL=Client_UserConsole /qb!- /l C:\Windows\DeployLogs\DRA.log"

    I’ve also tried the below, but that didn’t work either:
    Execute-MSI -Action 'Install' -Path "$InstallPath\DRAInstaller.msi" -Transform 'DRA.mst' -Parameters "ADDLOCAL=Client_UserConsole /qb!-" -LoggingOptions '/l' -LogName "C:\Windows\DeployLogs\DRA.log"

    What am I doing wrong?

  • Nick
    Post count: 4

    The Toolkit automatically generates a verbose log under the “C:\windows\logs\software” folder. So all you need is Execute-MSI -Action ‘Install’ -Path “$InstallPath\DRAInstaller.msi” -Transform ‘DRA.mst’ -Parameters “ADDLOCAL=Client_UserConsole /qb!”

  • Brian
    Post count: 1

    Use Addparameters instead, otherwise you will override the default properties. Log will be created in C:\Windows\Logs\Software

    Execute-MSI -Action Install -Path "DRAInstaller.msi" -Transform "DRA.mst" -AddParameters "ADDLOCAL=Client_UserConsole"

  • Gordo
    Post count: 11

    Okay, I figured this out. I already knew about the default log created at C:\Windows\Logs\Software, so thanks to the folks who responded about that.

    What I was looking for was a separate log file that was specific to just the MSI install I was running within the larger PowerShell script. As I’d stated, I was running that with the Execute-MSI command from within the PowerShell script.

    And it turns out you CAN generate a log file specific to the MSI install. What you CAN’T do, apparently, is specify a location. So instead of using -LogName “C:\Windows\DeployLogs\DRA.log”, what I really needed to do was -LogName “DRA.log”.

    This creates a log file specific to the MSI install, and that log file, along w/ the default PowerShell log file for the entire script, will be located in C:\Windows\Logs\Software.

    Problem solved!

  • Scott
    Post count: 3


    There is the ability to modify the log location, for the PSADT and MSI logs

    From PSAppDeploymentToolkitAdminGuide.docx page 16

    The default log directory for the toolkit and MSI log files can be specified in the XML configuration file. The default directory is C:\Windows\Logs\Software

    This is the xml file AppDeployToolkitConfig.xml. I am seeing line 18 is where to change this for PSADT and below for the MSI logs.

    • This reply was modified 6 months, 4 weeks ago by  Scott.

You must be logged in to reply to this topic.