How to Install Microsoft IIS 10 Using PowerShell

How to Install Microsoft IIS 10 Using PowerShell

In this blog post, I’ll show you How to Install Microsoft IIS 10 Using PowerShell

Using Microsoft PowerShell to Install server roles Is very handy, especially with Web Servers where we can many Front-End Web Server proxying connections and not storing any data.

With Windows Containers, the only way to Install IIS Is using PowerShell cmdlets with DockerFile.

Using PowerShell to automate IIS deployments can easily Increase consistency, efficiency uptime and performance In the environment and reduce the number of updates the machines needs during patching time.

I’ve seen many applications that didn’t work properly because some components were Installed on one Front End Server and not the other causing all kind of unexpected behavior and results.

Luckily, we can use PowerShell to standardize our Installation process and components across the deployment.

To get started. I’ll use the cmdlet below to list all IIS roles and features, from the list I’ll pick up the items I need to Install.

Get-windowsFeature web-*
How to Install Microsoft IIS 10 Using PowerShell
How to Install Microsoft IIS 10 Using PowerShell

In my case, I’m Installing IIS default components and IIS management tools, to make sure it works I will use the -WhatIf line first to test.

Add-WindowsFeature Web-Mgmt-Tools, Web-Server -WhatIf
How to Install Microsoft IIS 10 Using PowerShell
How to Install Microsoft IIS 10 Using PowerShell

And finally, To install IIS 10 and the IIS management tools I’ll use the line below.

Add-WindowsFeature Web-Mgmt-Tools, Web-Server

Note: To Install it on a remote Server we could use the same cmdlet with computer name switch as shown below.

Add-WindowsFeature Web-Mgmt-Tools, Web-Server -ComputerName SERVERNAME

As you can see below, IIS Is Installed and running

Search








Bitnami