commands

^

Get-DbaManagementObject

Author Ben Miller (@DBAduck), dbaduck.com
Availability Windows, Linux, macOS

 

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

Synopsis

Gets SQL Management Object versions installed on the machine.

Description

The Get-DbaManagementObject returns an object with the Version and the
Add-Type Load Template for each version on the server.

Syntax

Get-DbaManagementObject
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [[-VersionNumber] <Int32>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaManagementObject

Returns all versions of SMO on the computer

Example: 2
PS C:\> Get-DbaManagementObject -VersionNumber 13

Returns just the version specified. If the version does not exist then it will return nothing.

Optional Parameters

-ComputerName

The name of the Windows Server(s) you would like to check.

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

This command uses Windows credentials. This parameter allows you to connect remotely as a different user.

Alias
Required False
Pipeline false
Default Value
-VersionNumber

This is the specific version number you are looking for. The function will look
for that version only.

Alias
Required False
Pipeline false
Default Value 0
-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