I am trying to remotely install .NET framework4.6.1 on a large group of machines. I'm using powershell to remotely script this. The problem is that for whatever reason the .exe does not seem to want to be invoked remotely. I am assuming this is due to the fact that the .exe for the upgrade launches a UI session. However, even passing the "/q" parameter which should allow the install to take place remotely, it still doesn't work. I don't get any errors, and when RDP'd into the machine in question it doesn't appear to be upgrading or using any CPU for the upgrade.
My Script:
Write-Host "Executing 'Upgrade dotnet 4.6' for $server"
Invoke-Command -ComputerName $servers -Credential $credentials -ScriptBlock {
$Url = 'https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe'
$Exe = "net461.exe"
$Dest = "C:\\" + $Exe
$Params = " /q"
$client = new-object System.Net.WebClient
$client.DownloadFile($Url,$Dest)
Invoke-Expression ("cmd.exe /C " + $Dest + $Params)
}
I've also tried using chocolatey and it doesn't work either, for I think the same reasons. running chocolatey locally works.