1

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?

4

1 回答 1

1

如果您使用的是 Windows Server 2008 R2 及更高版本,则可以使用 PowerShell 服务器管理器模块来安装 ASP.NET

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

资源:

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/

于 2014-04-08T11:57:35.060 回答