commands

^

Test-DbaManagementObject

Author Ben Miller (@DBAduck), http://dbaduck.com
Availability Windows only

 

Synopsis

Tests to see if the SMO version specified exists on the computer.

Description

The Test-DbaManagementObject returns True if the Version is on the computer, and False if it does not exist.

Syntax

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

 

Examples

 

Example: 1
PS C:\> Test-DbaManagementObject -VersionNumber 13

Returns True if the version exists, if it does not exist it will return False

Required Parameters

-VersionNumber

This is the specific version number you are looking for and the return will be True.

Alias
Required True
Pipeline false
Default Value

Optional Parameters

-ComputerName

The name of the target 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
-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 Test-DbaManagementObject on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaManagementObject.