This function recursively finds all objects that depend on the input. It will then retrieve rich information from them, including their creation scripts and the order in which it should be applied.
By using the ‘Parents’ switch, the function will instead retrieve all items that the input depends on (including their creation scripts).
For more details on dependency, see: [technet.microsoft.com](https://technet.microsoft.com/en-us/library/ms345449(v=sql.105)
To return objects that depend on the “Customers” table
(Get-DbaDatabase -SqlInstance sql2012 Northwind).tables | Where Name -eq Customers | Get-DbaDependency
This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.