Command line arguments for msiexec break on powershell if they contain space

前端 未结 3 1086
萌比男神i
萌比男神i 2020-12-19 01:36

I\'m trying to set a public property in an installshield installer with a value containing space. While running the MSI installer I\'m using below command on PowerShell comm

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 02:12

    This is the best way to install a program in general with Powershell.

    Here's an example from my own script:

    start-process "c:\temp\SQLClient\sqlncli (x64).msi" -argumentlist "/qn IACCEPTSQLNCLILICENSETERMS=YES" -wait
    

    Use Start-Process "Path\to\file\file.msi or .exe" -argumentlist (Parameters) "-qn or whatever" -wait.

    Now -wait is important, if you have a script with a slew of programs being installed, the wait command, like piping to Out-Null, will force Powershell to wait until the program finishes installing before continuing forward.

提交回复
热议问题