Installing the Web Server role with PowerShell
If you've been following this book from the beginning, you will hopefully know what's coming here. We've been showing the PowerShell methods for accomplishing tasks for a lot of previous recipes. If you haven't started using our PowerShell examples to accomplish some of your regular Windows Server tasks, then you can start now! PowerShell can be used in Windows Server 2019 to accomplish any task or configuration inside the operating system. I am a huge fan of using the keyboard instead of the mouse in any circumstance and saving scripts that can be used over and over to save time in the future.
In this recipe, we are going to explore the Install-WindowsFeature
cmdlet, which can be used to add a role or roles to your Server 2019. Since we are discussing IIS in this chapter, we'll take our newly created web server and use PowerShell to place the Web Server (IIS) role onto it.
Getting ready
There is a new...