Silently install the .NET framework v4.0

Download and install the .NET framework v4.0

<#
.SYNOPSIS
    SilentInstallNET - Download and Install silently the .NET framework v4.0.
.NOTES
    File Name  : SilentInstallNET.ps1
    Author     : Fabrice ZERROUKI - fabricezerrouki@hotmail.com
.EXAMPLE
    PS D:\>SilentInstallNET.ps1
#>
$TempFolder = "D:\DOWNLOADED_APPLICATIONS"
if(!(test-path $TempFolder))
{New-Item -path $TempFolder -type directory}
 
Write-Host ""
Write-Host "Downloading .NET framework v4.0 installation package" -ForegroundColor Yellow;
$src = "http://www.microsoft.com/downloads/info.aspx?na=41&SrcFamilyId=0A391ABD-25C1-4FC0-919F-B21F31AB88B7&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2f5%2fA%2f95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE%2fdotNetFx40_Full_x86_x64.exe"
$dest = "$TempFolder" + "\" + "dotNetFx40_Full_x86_x64.exe"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($src, $dest)
$args = " /q /norestart"
Write-Host "Installing .NET framework v4.0" -ForegroundColor Yellow;
Start-Process -FilePath $dest -ArgumentList $args -Wait
 
Remove-Item $TempFolder -recurse

Leave a Reply

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

Scroll to Top