Created
February 17, 2018 19:45
-
-
Save justinsoliz/34324700ea93c7b77b4ac3e132584de7 to your computer and use it in GitHub Desktop.
Powershell - Install Sql Server Management Studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 2016 SSMS..." | |
$URL = "https://download.microsoft.com/download/3/1/D/31D734E0-BFE8-4C33-A9DE-2392808ADEE6/SSMS-Setup-ENU.exe" | |
$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 2016 install..." -nonewline | |
$Parms = " /Install /Quiet /Norestart /Logs log.txt" | |
$Prms = $Parms.Split(" ") | |
& "$filepath" $Prms | Out-Null | |
Write-Host "SSMS installation complete" -ForegroundColor Green |
It worked super fast. Thanks for the script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently the pipeline doesn't wait for the exe to finish download so the artifact it produces has 0KB , any ideas how to fix this?