Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Add-DbaExtendedProperty on GitHub.
Want to see the Bill Of Health for this command? Check out Add-DbaExtendedProperty.
Adds an extended property
Adds an extended property
This command works out of the box with databases but you can add extended properties from several different types of objects, including:
Aggregate
Assembly
Column
Constraint
Contract
Database
Event Notification
Filegroup
Function
Index
Logical File Name
Message Type
Parameter
Partition Function
Partition Scheme
Procedure
Queue
Remote Service Binding
Route
Rule
Schema
Service
Synonym
Table
Trigger
Type
View
Xml Schema Collection
Add-DbaExtendedProperty
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-Database] <String[]>]
[-Name] <String>
[-Value] <String>
[[-InputObject] <PSObject[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Add-DbaExtendedProperty -SqlInstance Server1 -Database db1 -Name version -Value "1.0.0"
Sets the version extended property for the db1 database to 1.0.0
PS C:\> Get-DbaDbStoredProcedure -SqlInstance localhost -Database tempdb | Add-DbaExtendedProperty -Name SPVersion -Value 10.2
Creates an extended property for all stored procedures in the tempdb database named SPVersion with a value of 10.2
PS C:\> Get-DbaDbTable -SqlInstance localhost -Database mydb -Table mytable | Add-DbaExtendedProperty -Name MyExtendedProperty -Value "This is a test"
Creates an extended property named MyExtendedProperty for the mytable table in the mydb, with a value of "This is a test"
The name of the extended property
Alias | Property |
Required | True |
Pipeline | false |
Default Value |
The value for the extended property
Alias | |
Required | True |
Pipeline | false |
Default Value |
The target SQL Server instance
Alias | |
Required | False |
Pipeline | false |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Add an extended property to a specific database
Alias | |
Required | False |
Pipeline | false |
Default Value |
Enables piping from Get-Dba* commands
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
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 |
Shows what would happen if the command were to run. No actions are actually performed.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
Prompts you for confirmation before executing any changing operations within the command.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |