commands

^

Get-DbaInstalledPatch

Author Hiram Fleitas, @hiramfleitas, fleitasarts.com
Availability Windows only

 

Synopsis

Retrives a historical list of all SQL Patches (CUs, Service Packs & Hot-fixes) installed on a Computer.

Description

Retrives a historical list of all SQL Patches (CUs, Service Packs & Hot-fixes) installed on a Computer.

To test to see if your build is up to date, use Test-DbaBuild.

Syntax

Get-DbaInstalledPatch
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaInstalledPatch -ComputerName HiramSQL1, HiramSQL2

Gets a list of SQL Server patches installed on HiramSQL1 and HiramSQL2.

Example: 2
PS C:\> Get-Content C:\Monitoring\Servers.txt | Get-DbaInstalledPatch

Gets the SQL Server patches from a list of computers in C:\Monitoring\Servers.txt.

Example: 3
PS C:\> Get-DbaInstalledPatch -ComputerName SRV1 | Sort-Object InstallDate.Date

Gets the SQL Server patches from SRV1 and orders by date. Note that we use
a special customizable date datatype for InstallDate so you'll need InstallDate.Date

Optional Parameters

-ComputerName

Allows you to specify a comma separated list of servers to query.

Alias
Required False
Pipeline true (ByValue)
Default Value $env:COMPUTERNAME
-Credential

Credential object used to connect to the Computer as a different user.

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False

 

Want to see the source code for this command? Check out Get-DbaInstalledPatch on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaInstalledPatch.