Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Install dotnet 4.5 powershell

$
0
0

the script is take from below link and modified for my lab testing I have commented out few lines.

Basically I save the below file as ps1 and I run .

Invoke-command -computername abc -filepath c:\script\name.ps1  .the script will run file locally but not remotely any help would be appreciated

http://www.zerrouki.com/silently-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 = "C:\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 = "\\ramads004\dotnet\dotNetFx40_Full_x86_x64.exe"
$dest = "$TempFolder" + "\" + "dotNetFx40_Full_x86_x64.exe /quiet /norestart"
#$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
Invoke-Expression $dest
Write-Output "Dot net 4.5 installed"
start-sleep -seconds 360
# Remove-Item $TempFolder -recurse

also followed this article but doesn't work for me remotely

http://social.technet.microsoft.com/Forums/windowsserver/ar-SA/3045eb24-7739-4695-ae94-5aa7052119fd/install-dotnet-framework-4-using-powershell?forum=winserverpowershell


Viewing all articles
Browse latest Browse all 21975

Trending Articles