Download all SC 2012 SP1 Evaluation VHD files with PowerShell
I was going to download the evaluation VHD´s for System Center 2012 SP1 and doing that the manual way by clicking on each of the links on the download pages and that for all SC 2012 products could seriously give you mental illness, If I counted the files correct it is 99 total + documents.
I found this guest post on the ScriptingGuys page where Marco did a PowerShell line how to not only find the files but also add them to BITS for download. This script only works on PowerShell v3.0 because it is using the new Invoke-WebRequest cmdlet, and as you can see on the screendump how easily you can get all download links.
I have set the new url´s for SC 2012 SP1 RTM eval vhd´s and added the .docx files and also do a check that in the volume you will store them have enough space, I made the assumption that it is approximately 70 GB total (99 files * ~700 MB each)
Here You can copy this and run on your environment, It will take some hours but at least it saves you the time in clicking 😛
# Download all SC 2012 SP1 VHD Eval # # Niklas Akerlund / Lumagate 2013-02-04 # # Downloadfolder $Dest = "D:\VHDEVAL" $SizeOfSCSP1 = 70GB # Get Space on volume $SpaceRemaining = (Get-Volume $Dest.Split(":")[0]).SizeRemaining if($SpaceRemaining -gt $SizeOfSCSP1){ # SCVMM ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36435").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCOM ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36424").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCORCH ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36426").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCAC ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=34781").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCDPM ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36423").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCCM ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36428").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} # SCSM ((Invoke-WebRequest -Uri "http://www.microsoft.com/en-us/download/details.aspx?id=36427").links | ? href -match "rar$|exe$|docx$").href | %{Start-BitsTransfer -Source $_ -Destination $Dest} }else{ [int]$Sum = ($SizeOfSCSP1 - $SpaceRemaining)/1GB Write-Host "Free up at least $Sum GB and try again!" }
Comments
[…] http://vniklas.djungeln.se/2013/02/04/download-all-sc-2012-sp1-evaluation-vhd-files-with-powershell/ […]
[…] have already blogged about how to use PowerShell to download all of the System Center 2012 SP1 VHD evaluation files with PowerShell and […]