Automating .NET 3.5 installs on Windows 8 and Server 2012(R2)

I’ve been making the push to start deploying systems as 2012R2, 2008 is already almost 8 years old! Some programs require .NET 3.5 and installing it manually is a pain, even if you have a script built you still need to get the sources from somewhere, typically its from the CD which is a pain. Here is a much easier way if you dont have SCCM or a way to push/pull it.

 

First grab the “sxs” folder on your install medium (located in the sources folder) and place it on your network available to all. (ie. \\SERVERNAME\Sources\8.1\sxs)

Second make a powershell script with the following:

Make sure to add the path you created to get to the share, drop the powershell script where ever you would like and run it as an admin. Simple, fast, and easy!

 

Note: Depending on your environment you may need to set your execution policy or bypass it.

1 comment… add one
  • Ryan Link Reply

    The powershell version would look like this, don’t forget you can always bake in the -WhatIf and -Restart parameters as well.

    $source = “\\myserver\sources\windows2012r2\sxs”
    $myBaseRoles = “NET-Framework-Core” # comma seperated list of roles
    $arguments = ” $myBaseRoles -source $source ”
    $addWinFeatures = “Add-WindowsFeature$arguments”
    Invoke-Expression $addWinFeatures

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.