Got an update on this install script. Working with one of our customers we came up with an install script that should allow exit codes to be reported back to the activity log.
exit (Start-Process -FilePath ‘msiexec.exe’ -ArgumentList (‘NESSUS_GROUPS=“TC_Windows_10” NESSUS_SERVER=“cloud.tenable.com:443” NESSUS_KEY=REMOVED /qn’, ‘/i’, ‘“NessusAgent7.7.0x64.msi”’) -Wait -Passthru).ExitCode
Legend; we quite literally wrote one yesterday too! Almost identical.
exit (Start-Process -FilePath ‘msiexec.exe’ -ArgumentList (’/qn’, ‘/i’, ‘“NessusAgent-7.6.3-x64.msi”’, ‘NESSUS_GROUPS=“GROUPNAME”’, ‘NESSUS_SERVER=“cloud.tenable.com:443”’, ‘NESSUS_KEY=REMOVED’) -Wait -Passthru).ExitCode
I’ve tried both start-process methods here and couldn’t get either to work on Server 2019 using the 8.3.1 x64 installer. I finally got this version to work in the execution code. The main difference is the lack of parenthesis around the argumentlist section and the single quote around the msi filename.
exit (Start-Process -FilePath ‘msiexec.exe’ -ArgumentList ‘/l* c:\temp\nessus-install-log.txt’, ‘/qn’, ‘/i’, ‘NessusAgent-8.3.1-x64.msi’, ‘NESSUS_GROUPS=“Servers”’, ‘NESSUS_SERVER=“cloud.tenable.com:443”’, ‘NESSUS_KEY=12345removed678’ -Wait -Passthru).ExitCode