SqlPeek
A PowerShell module for fast, read-only exploration of SQL Server — schema, row counts, and column sampling without opening SSMS.
Most of my database questions are small: what's in this table, does this column ever go null, is the job actually writing rows. Answering them in SSMS means a connection dialog, a query tab, SELECT TOP 100, and a copy-paste into Excel. SqlPeek collapses that into a line at the PowerShell prompt — peek Orders, pktab, pkfind "email".
The decision I spent the most time on was how to move rows. The naive PowerShell pattern, $rows += $row in a loop, reallocates the whole array on every iteration; on a 40k-row result it's miserable. SqlPeek streams a SqlDataReader into a pre-sized List[psobject] with cached column names and a reused buffer, and comes out about 36x faster. Rows land as plain [pscustomobject] with native CLR types, so Get-Member, Out-GridView, and tab-completion all just work.
It's read-only by construction: every statement has to be a single SELECT, identifiers are checked against an allow-list, and values go as parameters. Poking around a production database with it is about as eventful as ls.
If I did it again I'd design the multi-connection story up front instead of bolting a default session on afterward — it works, but the seams show.
More PowerShell: SysOps.