Ahhh! It all about ‘knowing’ how the commands work
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