Execute-msi with -addparameters TFTP= and devicename=

Hello There,

I hva issue getting this command works on appdeploytoolkit.

cmd command is working perfectly fine:

#msiexec /i Setup.msi REBOOT=ReallySuppress /qb Devicename=“Intel(R) Ethernet Connection I218-LM” TFTP1=“x.x.x.x” TFTP2=“x.x.x.x”

few command tested but no sucess :frowning:

Execute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters “Devicename=”“Intel(R) Ethernet Connection I218-LM”" TFTP1=““x.x.x.x”” TFTP2=““x.x.x.x””" REBOOT=ReallySuppress

xecute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters ‘REBOOT=ReallySuppress /QN’ -AddParameters “Devicename=Intel(R) Ethernet Connection I218-LM TFTP1=x.x.x.x TFTP2=x.x.x.x”

Execute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters "/i /v /norestart “Devicename=Intel(R) Ethernet Connection I218-LM TFTP1=x.x.x.x TFTP2=x.x.x.x " /QN”

If anyone experienced this before, feel free to share your thoughts ok…thanks!

The problem you are facing is allmost certainly to do with the quotes…

You currently have:

Execute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters “Devicename=”“Intel(R) Ethernet Connection I218-LM”" TFTP1=““x.x.x.x”” TFTP2=““x.x.x.x””" REBOOT=ReallySuppress

Execute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters ‘REBOOT=ReallySuppress /QN’ -AddParameters “Devicename=Intel(R) Ethernet Connection I218-LM TFTP1=x.x.x.x TFTP2=x.x.x.x”

Execute-MSI -Action ‘Install’ -Path “$dirfiles\Setup.msi” -Parameters "/i /v /norestart “Devicename=Intel(R) Ethernet Connection I218-LM TFTP1=x.x.x.x TFTP2=x.x.x.x " /QN”

As well as correcting your code to use ANSI single or double quotes (i.e. ' or "), You need to either use single quotes to wrap the content of the parameters or escape the extra double quotes, so you code could look like this:

Execute-MSI -Action 'Install' -Path "$dirfiles\Setup.msi" -Parameters 'REBOOT=ReallySuppress /QB Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"' 

This way you are single quoting all your parameters, i.e. everything from REBOOT through to TFTP2="x.x.x.x" etc… whilst still double quoting each parameter value as required.
The alternative is to use double quotes but you would then need to escape certain double quotes with a back tick e.g: ` so you get the correct result

Hi @Adrian_Scott,

thank for your prompt feedback. I will test this and revert back the status ok!!

Appreciate it.

this command is working! i was so confuse where to put the ’ and " and how about addparameters? when to use addparameters @Adrian_Scott ?

Ahhh! It all about ‘knowing’ how the commands work :wink:
Let me break it down a little based on your original msiexec installation commandline

msiexec /i Setup.msi REBOOT=ReallySuppress /qb Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"

so, msiexec can be replaced with the PSADT command Execute-MSI
/i is equivalent to the -Action 'Install' switch on Execute-MSI
Setup.msi is equivalent to the -Path "$dirfiles\Setup.msi" switch on Execute-MSI
and finally:
REBOOT=ReallySuppress /qb Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x" are all the installation Parameters, but because of the various double quotes within the string, you need to make sure you are not closing them when they should be opened or opening them when they should be closed.
So in the PowerShell command you want the whole string after the -Parameters switch, either wrapped in single quotes e.g.:

-Parameters 'REBOOT=ReallySuppress /qb Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"'

or wrapped in escaped (`) double quotes, in one of two ways e.g.:

-Parameters `"REBOOT=ReallySuppress /qb Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"`"

or:

-Parameters "REBOOT=ReallySuppress /qb Devicename=`"Intel(R) Ethernet Connection I218-LM`" TFTP1=`"x.x.x.x`" TFTP2=`"x.x.x.x`""


So the final command will look like one of the following 3 options:

Execute-MSI -Action 'Install' -Path "$dirfiles\Setup.msi" -Parameters 'REBOOT=ReallySuppress /QB Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"'

or

Execute-MSI -Action 'Install' -Path "$dirfiles\Setup.msi" -Parameters `"REBOOT=ReallySuppress /QB Devicename="Intel(R) Ethernet Connection I218-LM" TFTP1="x.x.x.x" TFTP2="x.x.x.x"`"

or

Execute-MSI -Action 'Install' -Path "$dirfiles\Setup.msi" -Parameters "REBOOT=ReallySuppress /QB Devicename=`"Intel(R) Ethernet Connection I218-LM`" TFTP1=`"x.x.x.x`" TFTP2=`"x.x.x.x`""

As for the -AddParameters switch, I personally have never needed to use them, as I have not needed to override the defaults, your best bet is to review the PSADT reference here:

I hope this might help grow your understanding

3 Likes

@Adrian_Scott, your explanation was nothing short of extraordinary! My gratitude knows no bounds, you truly are the epitome of excellence!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.