Reputation: 1164
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
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://tech.toptable.co.uk/blog/2013/06/14/windows-feature-management-with-powershell/
Upvotes: 1