0

My requirement is to add Role services in windows 2008 R2 machine.And i am using command like this

Import-Module ServerManager
Add-WindowsFeature "Web-Server" -Restart:$true
Write-Host "i am back after installation"
Add-WindowsFeature "Application-Server" -Restart:$true 

But this -restart:$true is not actually re-starting the system.If this not the way how i can achieve this.Because addition of one role services expects a restart and after that only i will be able to add another role. Please help :)

1
  • Do you get any error message from the first Add-WindowsFeature? Commented Jun 4, 2013 at 14:29

1 Answer 1

2

Add-WindowsFeature accepts a string[] (array of strings) for the -Name parameter. You should be able to add multiple features by calling the cmdlet only once.

Add-WindowsFeature -Name "Web-Server","Application-Server"

Then restart the server.

Sign up to request clarification or add additional context in comments.

1 Comment

This is failing with error saying needs to restart in between.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.