Good day, I’m a newbie with regards to PowerShell, so apologies if the question has already been answered in the past.
I’m in the need to provision a Windows 2012r2 server vagrant box on a Linux workstation. The vagrant file supports post-install scripting using the Powershell 4.x command line from the server.
Everything is almost fine, except by the fact that I have to download and install three components from Microsoft websites. Two are Windows updates (MSU packages) and one is an executable.
I know the command line to script the installation of these components, but what I fail is the download.
I’m using this syntax:
(Net-Object) System.Net.WebClient).DownloadFile('https://www.microsoft.com/en-us/download/confirmation.aspx?id=42153', 'C:\Users\vagrantDownloadsfile.msu')
This seem to only dump the offering HTML webpage (~ 100k of content) in file.msu, instead of the real msu file (~ 10Mb).
I guess that this is not the correct approach, so what would be the correct way to grab the file? maybe MS is not allowing unattended downloads from their websites?
submitted by /u/JustADirtyLurker
[link] [comments]
The post Download msu and installers from Microsoft websites appeared first on How to Code .NET.