5

I have seen quite a few resources to silent install sql server 2008 with CMD line. Does anyone know how to silent install sql server 2008 with PowerShell and what should I configure? Thanks

alain.janinm
  • 19,951
  • 10
  • 65
  • 112
user911011
  • 51
  • 1
  • 2

2 Answers2

3

The silent install with SQL Server 2008 would work the same way whether you called it from the command line or from a PowerShell script. You would simply need to change around how you call the installer and pass the parameters for the configuration in PowerShell. It can get cumbersome calling external programs from PowerShell and passing the parameters to it as well. I believe you would use invoke-expression to call the command with the parameters. I honestly have not tried using PowerShell for this function since it works so well and easily in the dos prompt.

Community
  • 1
  • 1
2

Given that from a command prompt you would run something like this:

[path]\setup.exe /Q /other_args

In PowerShell you could just call the same thing using something like this:

$cmd = "[path]\setup.exe /Q /other_args";
Invoke-Expression -command $cmd | out-null;

I haven't done this personally but that would be the first approach I would try if it were my task.

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
  • still have not figured out how you folks type so fast :) –  Aug 25 '11 at 03:52
  • Hey you only beat me by about 20 seconds and you typed a lot more than I did. :-) – Aaron Bertrand Aug 25 '11 at 04:12
  • well I count points for including code :) I have not used invoke cmdlets much so was not positive on how it would be done. Plus I had a funny fealing someone was typing an answer too :) –  Aug 25 '11 at 04:17