functionGet-DbaSqlModule{<#
.SYNOPSIS
Displays all objects in sys.sys_modules after specified modification date. Works on SQL Server 2008 and above.

.DESCRIPTION
Quickly find modules (Stored Procs, Functions, Views, Constraints, Rules, Triggers, etc) that have been modified in a database, or across all databases.
Results will exclude the module definition, but can be queried explicitly.

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

.PARAMETER NoSystemDb
Allows you to suppress output on system databases

.PARAMETER NoSystemObjects
Allows you to suppress output on system objects

.PARAMETER 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.

process{foreach($instancein$SqlInstance){try{Write-Message-LevelVerbose-Message"Connecting to $instance"$server=Connect-SqlInstance-SqlInstance$instance-SqlCredential$sqlcredential-MinimumVersion10}catch{Stop-Function-Message"Failure"-CategoryConnectionError-ErrorRecord$_-Target$instance-Continue}