Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Install SQL PowerShell Tools

Posted on October 14, 2015October 14, 2015 By David Kittell

To install the 2014 PowerShell tools, the script below will help make it a bit easier.

First all downloads are referenced from this URL (specific for SQL 2014)
http://www.microsoft.com/en-ca/download/details.aspx?id=42295

I use Windows 64-Bit so if you use 32-Bit make sure you update your links

# Microsoft® Windows PowerShell Extensions for Microsoft SQL Server® 2014
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/PowerShellTools.msi
# Microsoft® SQL Server® 2014 Shared Management Objects
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/SharedManagementObjects.msi
# Microsoft® System CLR Types for Microsoft SQL Server® 2014
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/SQLSysClrTypes.msi
# Microsoft® Windows PowerShell Extensions for Microsoft SQL Server® 2014
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x86/PowerShellTools.msi
# Microsoft® SQL Server® 2014 Shared Management Objects
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x86/SharedManagementObjects.msi
# Microsoft® System CLR Types for Microsoft SQL Server® 2014
https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x86/SQLSysClrTypes.msi
# Directory Parameter
$FileDirectory = "C:\Temp\PowerShell_Tools\"

# Delete directory if it exists
if(Test-Path $FileDirectory)
    {
        Remove-Item -Recurse -Force $FileDirectory
         mkdir $FileDirectory;
}
else
{
    mkdir $FileDirectory;
        # cd $FileDirectory;
}


    $hostfiltered = ""


clear
$ServerList = "https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/PowerShellTools.msi","https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/SharedManagementObjects.msi","https://download.microsoft.com/download/1/3/0/13089488-91FC-4E22-AD68-5BE58BD5C014/ENU/x64/SQLSysClrTypes.msi"

$FileNumber = 1

write-host $ServerList.count total host lists read from file
foreach ($line in $ServerList)
{
   # write-host $line

    # We assume the file you download is named what you want it to be on your computer
    $FileName = [System.IO.Path]::GetFileName($line)

    $FullFilePath = "$($FileDirectory)$($FileName)"

    # write-host     $FullFilePath 
       
    # Give a basic message to the user to let them know what we are doing
    Write-Host "`r`nDownloading '$line' to '$FullFilePath'"
    
    # Download - Start
    $uri = New-Object "System.Uri" "$line" 
    $request = [System.Net.HttpWebRequest]::Create($uri) 
    $request.set_Timeout(15000) #15 second timeout 
    $response = $request.GetResponse() 
    $totalLength = [System.Math]::Floor($response.get_ContentLength()/1024) 
    $responseStream = $response.GetResponseStream() 
    $targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $FullFilePath, Create 
    $buffer = new-object byte[] 10KB 
    $count = $responseStream.Read($buffer,0,$buffer.length) 
    $downloadedBytes = $count 
    while ($count -gt 0) 
    {         
        [System.Console]::Write("`r`nDownloaded {0}K of {1}K", [System.Math]::Floor($downloadedBytes/1024), $totalLength) 
        $targetStream.Write($buffer, 0, $count) 
        $count = $responseStream.Read($buffer,0,$buffer.length) 
        $downloadedBytes = $downloadedBytes + $count 
    } 
  
    $targetStream.Flush()
    $targetStream.Close() 
    $targetStream.Dispose() 
    $responseStream.Dispose() 
    
    # Give a basic message to the user to let them know we are done
    Write-Host "`r`nDownload complete"
    # Download - Stop   

     $FileNumber = $FileNumber + 1
}

dir "$($FileDirectory)*.msi"  | Unblock-File

.\SQLSysClrTypes.msi /qr /norestart
.\SharedManagementObjects.msi /qr /norestart
.\PowerShellTools.MSI /qr /norestart

Reference: http://www.jbmurphy.com/2014/01/16/quickly-install-the-sql-powershell-toolls-on-your-local-machine/

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell SQL

Post navigation

Previous post
Next post

Related Posts

PowerShell Download Latest WordPress Plugin

Posted on September 17, 2015

This script will call out to a defined URL to check the version of a plugin and download the update if needed. To use: # Download only (if web is newer) #powershell -file DownloadLatestWordPressPlugin.ps1 <WordPress URL> <WordPress Plugin Version Installed> <Download Path> powershell -file DownloadLatestWordPressPlugin.ps1 https://wordpress.org/plugins/akismet/ 3.1.3 c:usersdkittelldesktopdownload # Download…

Read More

Calculate Age

Posted on September 18, 2013October 26, 2015

public static Int32 GetAge(this DateTime dateOfBirth) { var today = DateTime.Today; var a = (today.Year * 100 + today.Month) * 100 + today.Day; var b = (dateOfBirth.Year * 100 + dateOfBirth.Month) * 100 + dateOfBirth.Day; return (a – b) / 10000; } var now = float.Parse(DateTime.Now.ToString("yyyy.MMdd")); var dob = float.Parse(dateOfBirth.ToString("yyyy.MMdd"));…

Read More

PHP – WordPress – Blog Info

Posted on February 16, 2016

This is a simple piece of code to provide basic information about your blog. The first lines of the code will restrict the PHP access to the command line interface (CLI) so not just anyone could/should be able to see the details. Additional Mime Types can be seen at: http://codex.wordpress.org/Function_Reference/get_allowed_mime_types…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes