Follow up on my Teams install question

I recently posted a question regarding the new Teams and how to get it installed. As part of that installation I need to install/update the meeting add-in for Microsoft Office. I have the commands working in PS - taken from a working script. How would this look in PSADT syntax?

New-Item -ItemType Directory -Path "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin" -Force | Out-Null
New-Item -ItemType File "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log" -Force | Out-Null

and

Start-Process "msiexec" -ArgumentList @("/i ""$MSTAddinMSI""","/qn","/norestart ALLUSERS=1 TARGETDIR=""$targetDir"" /L*V ""C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log""") -Wait

I have tried some with Start-ADTMsiProcess but cannot get my head around the syntax for the argument list, it's the same with the next command.

Start-Process "c:\windows\System32\regsvr32.exe" -ArgumentList @("/s","/n","/i:user ""$targetDir\x64\Microsoft.Teams.AddinLoader.dll""") -wait

You are probably struggling with your command as it has a confused array of quotes :smiley:
This is what you currently have:

Start-Process "msiexec" -ArgumentList @("/i ""$MSTAddinMSI""","/qn","/norestart ALLUSERS=1 TARGETDIR=""$targetDir"" /L*V ""C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log""") -Wait

IMHO your variables should be written within $() to ensure that any spaces in the path are expanded correctly, and the use of double quotes should be simplified.
This is how it 'should ' probably look - Note the escaped double quotes using the ` character

Start-Process "msiexec" -ArgumentList @("/i $($MSTAddinMSI)","/qn","/norestart" "ALLUSERS=1" "TARGETDIR=`"$($targetDir)`"","/L*V `"C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log`"") -Wait

But you are right, using Start-ADTMsiProcess would be a much better route to achieve this as it is the Native PSADT method, reviewing the reference page here:

I'd start with something like this:

Start-ADTMsiProcess -Action 'Install' -FilePath $($MSTAddinMSI) -ArgumentList "/QN" -AdditionalArgumentList "/norestart","ALLUSERS=1","TARGETDIR=`"$($targetDir)`"" -LoggingOptions "/L*V" -LogFileName "C:\Program Files (x86)\Microsoft\TeamsMeetingAddin\MSTMeetingAddin.log" -PassThru

N.B. This is untested, so may not be quite right

Thank you! Your command almost works! I am not able to fix it though. :frowning:

Your screen grab shows you may still using the Start-Process "msiexec"... command, I suggest you use the Start-ADTMsiProcess -Action 'Install'... command instead and we can then advise as this is the native PSADT command
N.B. I have amended my Start-ADTMsiProcess command above as I missed the -ArgumentList "/QN" and I have also corrected the quotes around the various -AdditionalArgumentList entries

Am I?! I commented out the start-process (which works) so that should not be the case.

messages crossed in transit :smiley: , see my updated comment above

:smiley: getting closer, now only the log file is a problem, dont understand the C:\Windows\Logs....

OK, I think you'll need to work on that
TIP: PSADT logs to a default folder (This is defined in the config.psd1 file)
You need to review the Logging Options to decide what you need:

and LogFileName to define this correctly:

TIP: LogFileName is just that - Not the full path as I'd incorrectly supplied

I'll have a look. Actually it's the log file for the add-in so should not need the LogginOptions or the -LogFileName I guess. the options /L*V should take care of it. Anyways, thanks for the support. :slight_smile: