sc3w
sc3w

Reputation: 1164

How to register ASP.NET 4.0 for IIS using PowerShell Web Administration module?

I would like to register the ASP.NET 4.0 framework for IIS using a PowerShell script. I have previously used the aspnet_regiis.exe tool in the following way:

aspnet_regiis.exe –iru

This did the job, but I would like to refactor my code to use the PowerShell WebAdministration module to do this configuration. I already used it in my script to configure other things in IIS and I want to keep the sourcecode consistent.

There is a way to do this config. step using the WebAdministration module? I looked for the cmdlets from WebAdministration module, but I can't figure out which one could do the trick. Anyone could help me, please?

Upvotes: 1

Views: 3491

Answers (1)

Tom Hall
Tom Hall

Reputation: 4306

If you're using Windows Server 2008 R2 and above then you can use the PowerShell Server Manager module to install ASP.NET

Import-Module ServerManager
Add-WindowsFeature Web-Asp-Net

Resources:

http://www.iis.net/learn/install/installing-iis-85/installing-iis-85-on-windows-server-2012-r2#ModulesinIIS85

http://tech.toptable.co.uk/blog/2013/06/14/windows-feature-management-with-powershell/

Upvotes: 1

Related Questions