Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.