Many legacy applications require .NET Framework 3.5, which is crucial for running them. If you are an enterprise IT professional, you will receive this requirement.
In this tutorial, I will explain how to install .NET Framework 3.5 using PowerShell.
Prerequisites
These prerequisites are crucial, so make sure you have:
- You’re using Windows 10, 11, or Server 2012+.
- You have administrative privileges.
- PowerShell is running in administrator mode (important for system-level changes).
- You have either an internet connection or access to Windows installation media.
Install .NET Framework 3.5 Using PowerShell
Follow the below steps if you want to install .NET framework 3.5 using PowerShell.
Step 1: Open PowerShell with Administrative Privileges
To start, you need to open PowerShell with administrative privileges. You can do this by searching for “PowerShell” in the Start menu, right-clicking on “Windows PowerShell,” and selecting “Run as administrator.”
Step 2: Check for Existing .NET Framework 3.5 Installation
Before installing, it’s a good idea to check if .NET Framework 3.5 is already installed on your system. Run the following command in PowerShell:
Get-WindowsFeature -Name NET-Framework-FeaturesThis command will list the .NET Framework features installed on your system. Look for “NET-Framework-Core” to see if .NET 3.5 is already enabled.
Step 3: Install .NET Framework 3.5 Online
If .NET Framework 3.5 is not installed, you can proceed with the installation. The simplest method is to install it online using the following PowerShell command:
Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -AllHere:
Enable-WindowsOptionalFeature: Tells Windows to enable an optional Windows component.-Online: Means you’re modifying the currently running OS.-FeatureName "NetFx3": Targets the .NET Framework 3.5.-All: Installs all parent features needed (in this case, NetFx3 requires subcomponents too).
You can also try the below cmdlet.
Install-WindowsFeature -Name NET-Framework-CoreThis command will download and install .NET Framework 3.5 from the Internet. To avoid interruptions, ensure you have a stable internet connection.
Step 4: Install .NET Framework 3.5 Offline
If you are working in an environment without internet access, you can install .NET Framework 3.5 using the Windows installation media. Insert the installation media (DVD or USB) and note the drive letter (e.g., D:).
Run the following command, replacing “D:\sources\sxs” with the path to your installation media:
Install-WindowsFeature -Name NET-Framework-Core -Source D:\sources\sxsThis command will use the files from your installation media to install .NET Framework 3.5.
Step 5: Verify the Installation
After the installation is complete, verify that .NET Framework 3.5 is correctly installed by running the following command:
Get-WindowsFeature -Name NET-Framework-FeaturesYou should see that “NET-Framework-Core” is now listed as installed.
Check out Install RSAT in Windows 11 Using PowerShell
Use PowerShell DSC (Desired State Configuration)
If you’re deploying .NET 3.5 across multiple systems, DSC is a clean way to automate the install.
Here is the complete script:
Configuration InstallDotNet35 {
Node "localhost" {
WindowsFeature NetFx3 {
Ensure = "Present"
Name = "NetFx3"
IncludeAllSubFeature = $true
Source = "D:\sources\sxs" # Adjust as needed
}
}
}
InstallDotNet35
Start-DscConfiguration -Path .\InstallDotNet35 -Wait -Verbose -ForceRead Get Windows Update History Using PowerShell
Install .NET 3.5 Using Group Policy and PowerShell
In domain environments, you may want to use PowerShell along with Group Policy to deploy this feature.
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing" -Name "LocalSourcePath" -Value "D:\sources\sxs"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing" -Name "RepairContentServerSource" -Value 2Then run the regular install command:
Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -AllThis makes Windows look in the local folder first (like your ISO or USB) instead of Windows Update.
Download Microsoft .NET Framework 3.5
Here are the links if you want to download Microsoft .NET Framework 3.5 from the official site.
If you want to install .NET framework 3.5 in Windows Server operating systems from the GUI, then you can follow this article.
Conclusion
In this tutorial, I have explained how to install .NET framework 3.5 in Windows using PowerShell. Do let me know in the comment below if it solved your problem.
You may also like:
- Restart a Windows Service Using PowerShell
- Install Git on Windows Using PowerShell
- Install Windows Updates Using PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.