Jess Pomfret walks us through her recent contribution to dbatools:
I’ve been using this at work recently and it also relates to the presentation I gave at the ONSSUG June meeting around data compression. The beginnings of this script originated online as I dug into learning about the DMVs that related to objects and compression and then customized for what I needed.
If you run the below as is it will provide basic information about all objects in your database, except those in the ‘sys’ schema, along with their current size and compression level.
Click through for the script or, if your version of dbatools is up to date, call Get-DbaDbCompression
.