Skip to content

Instantly share code, notes, and snippets.

@SalimGangji
Forked from justinsoliz/ssms_install.ps1
Last active December 23, 2019 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalimGangji/576c9e6f20afe76ba1c23e9000250771 to your computer and use it in GitHub Desktop.
Save SalimGangji/576c9e6f20afe76ba1c23e9000250771 to your computer and use it in GitHub Desktop.
Powershell - Install Sql Server Management Studio
# Set file and folder path for SSMS installer .exe
$folderpath="c:\windows\temp"
$filepath="$folderpath\SSMS-Setup-ENU.exe"
#If SSMS not present, download
if (!(Test-Path $filepath)){
write-host "Downloading SQL Server SSMS..."
$URL = "https://aka.ms/ssmsfullsetup"
$clnt = New-Object System.Net.WebClient
$clnt.DownloadFile($url,$filepath)
Write-Host "SSMS installer download complete" -ForegroundColor Green
}
else {
write-host "Located the SQL SSMS Installer binaries, moving on to install..."
}
# start the SSMS installer
write-host "Beginning SSMS install..." -nonewline
$Parms = " /Install /Quiet /Norestart /Logs log.txt"
$Prms = $Parms.Split(" ")
& "$filepath" $Prms | Out-Null
Write-Host "SSMS installation complete" -ForegroundColor Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment