Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stevecondylios/477fba43bce461bfb1e11b2a4019b39d to your computer and use it in GitHub Desktop.
Save stevecondylios/477fba43bce461bfb1e11b2a4019b39d to your computer and use it in GitHub Desktop.
Powershell script to install both R and RStudio on Windows. NOTE: there are a couple of links in the script below - update them to ensure you install most recent versions
$dir = $env:TEMP;
Set-Location $dir
$urlRStudio = "https://download1.rstudio.org/desktop/windows/RStudio-1.2.1335.exe"
$outputRStudio = "$dir\RStudio.exe"
$wcRStudio = New-Object System.Net.WebClient
$wcRStudio.DownloadFile($urlRStudio, $outputRStudio) # $PSScriptRoot
$urlR = "https://cran.r-project.org/bin/windows/base/R-3.6.0-win.exe"
$outputR = "$dir\R-win.exe"
$wcR = New-Object System.Net.WebClient
$wcR.DownloadFile($urlR, $outputR)
$dirRStudio = $dir + "\RStudio.exe"
$dirR = $dir + "\R-win.exe"
Start-Process -FilePath $dirRStudio -ArgumentList "/S /v/qn"
Start-Process -FilePath $dirR -ArgumentList "/S /v/qn"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment