1

I want to install ASP.NET 4.x in a Windows Server 2008 R2 machine using Powershell DSC. Is there any PowerShell DSC resource for this?

Thank you!

Rosberg Linhares
  • 3,537
  • 1
  • 32
  • 35

2 Answers2

1

Yes, there is! I built a DSC resource for this:

https://www.powershellgallery.com/packages/cAspNetIisRegistration

Feel free to contribute with any bugs, feature requests or enhancements to this resource on its github repo.

Rosberg Linhares
  • 3,537
  • 1
  • 32
  • 35
0

I haven't tried with 4.0 but it would be similar to installing 4.6.1. However if a newer version of DotNet framework is already installed, the package won't install.

configuration InstallNetFramework
{
    package NetFramework4.6.1
    {
        Path = "C:\NDP461-KB3102436-x86-x64-AllOS-ENU.exe"
        ProductId = "8EEB28EE-5141-411C-9CF0-9952264FE4AF"
        Name = "Microsoft .NET Framework 4.6.1 Targeting Pack"
        Arguments = "/q"
    }
}

InstallNetFramework
N.Gupta
  • 326
  • 1
  • 5
  • The machine already have IIS and .NET Framework 4.5 installed. I want only to install (register) ASP.NET 4 through the aspnet_regiis tool. – Rosberg Linhares Oct 06 '16 at 18:55
  • 1
    You can use process resource to run aspnet_regiis tool to perform the installation. – N.Gupta Oct 06 '16 at 22:15
  • Ok @N.Gupta, this works but does not comply with the DSC idempotent principle. You must be able to apply the same configuration any number of times and, If the current state is the same as the desired state, no action must be taken. – Rosberg Linhares Oct 07 '16 at 15:28
  • If you are trying to register your ASP.Net application with IIS you can use the resources from xWebAdministration module. There are some samples on using it @ https://github.com/PowerShell/xWebAdministration/tree/dev/Examples. Beyond that you would probably have to write your own resource. – N.Gupta Oct 07 '16 at 17:14