0

I have to install a Exe file silently I only have access to the devices via powershell. The installer will ask for a serial number and path can this be done in PowerShell I have tried below with the silent command removed but it still prompts for the serial number

Start-Process -wait DATABASE12.EXE /silent -ArgumentList "ZZZZ-SSS-JJJ-XXXX" 'INSTALLDIR=c:\temp\App' 
mklement0
  • 382,024
  • 64
  • 607
  • 775
  • Try following : $arguments = '/silent ZZZZ-SSS-JJJ-XXXX INSTALLDIR=c:\temp\App' Start-Process DATABASE12.EXE -wait -ArgumentList $arguments – jdweng Dec 01 '22 at 17:53

1 Answers1

0

Note: This answer helps you with the syntax problem of your own attempt; solving that problem alone doesn't necessarily mean that the command will then work as expected - you'd have to consult the documentation for your specific executable, DATABASE12.EXE.


Your Start-Process call is syntactically invalid:

  • All pass-through arguments, including /silent, must be passed via -ArgumentList (-Args)

  • To pass them individually, use an array, i.e. separate the arguments with ,

Start-Process -Wait DATABASE12.EXE -ArgumentList /silent, ZZZZ-SSS-JJJ-XXXX, INSTALLDIR=c:\temp\App

However, due to a long-standing bug in Start-Process - see this answer - it is usually better to pass all pass-through arguments encoded in a single string (separated with spaces), which makes it easier to control embedded double-quoting, if necessary:

# Note: Parameter name -ArgumentList omitted for brevity.
Start-Process -Wait DATABASE12.EXE '/silent ZZZZ-SSS-JJJ-XXXX INSTALLDIR=c:\temp\App'
mklement0
  • 382,024
  • 64
  • 607
  • 775