SQLServerUpdatesModule – PowerShell

SQLServerUpdatesModule is a free PowerShell module returns information about the newest available updates for instance SQL Server.
Source for updates list  – http://sqlserverupdates.com

Minimum Requirements

Server
  • SQL Server 2008
  • PowerShell 4.0 with remoting enabled needed on the host for Windows commands
Workstation
  • Windows 7 with PowerShell v4
  • SQL Server 2008 R2 SMO or SSMS

SQLServerUpdatesModule is not required on the server.

I recommend to use the script at client stations, but I encourage to make a test at servers.

 

Install

1. Install from the PowerShell Gallery

Install-Module -Name SQLServerUpdatesModule

The PowerShell Gallery and the command Install-Module are natively available in Windows 10. If you run Windows 7 or 8 or 8.1, you can either install PackageManagement from powershellgallery.com

2. Download the zip directly and manually import the module.

Using module

Get-SQLServerUpdates – returns available updates list  (cumulatvie update, service pack) for SQL Server. Source for updates list  – http://sqlserverupdates.com/

Get-SQLServerUpdateList

Update list for all SQL Server from version 2008 to 2016.

Get-SQLServerUpdateList -Version „SQL Server 2016”

Update list only for SQL Server 2016

Additional information.

When I wrote this script I had a problem with Exception 0x800A01B6. I found solution at this site – link. In the script I use IHTMLDocument3_getElementsByTagName instead of method getElementsByTagName.

Show-SQLServerUpdatesReport  – returns information about deficit of installed updates at instance SQL Server.

Show-SQLServerUpdatesReport -Version ‚13.0.4422.0’

Returns information about deficit of installed updates for version builid SQL Server.

Show-SQLServerUpdatesReport -Version ‚12.0.4502’ | Select -Expand Updates

Returns information about deficit of installed updates for build number SQL Server. Expand properties Updates.

Show-SQLServerUpdatesReport -ServerInstance it-mn-m\mssqlserver14, test-agsqlserver

Returns information about deficit of installed updates for instance with parameter ServerInstance. This command returns objects.

Show-SQLServerUpdatesReport -ServerInstance it-mn-m\mssqlserver14, test-agsqlserver -HTML -Path C:\temp\report.html

Return information about deficit of installed updates for instances with parameter ServerInstance. This command returns report in the format html.

Example report – report.html

Errors and problems

Please send me information about errors and problems by email.

Z pasją poświęcam czas na zdobywanie wiedzy w zakresie szeroko rozumianej Data Platform. Zachwycony językiem skryptowym Windows PowerShell. Swoją wiedzę, doświadczenia i spostrzeżenia opisuję na blogu.

3 Comments

  1. Billy

    When trying to executed Show-SQLServerUpdatesReport -ServerInstance SERVER -HTML and entering a html file name in – I’m getting the following error.

    Cannot index into a null array.
    At C:\Program Files\WindowsPowerShell\Modules\SQLServerUpdatesModule\1.0.0.6\functions\Show-SQLServerUpdatesReport.ps1:216 char:21
    + … if (([double](($Instance.Build) -Replace „\.(.|..)\.”, „”) -g …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

    any idea how to fix this? I saw that others are seeing the same error.

    Thanks!

Leave a Reply

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *