• I work as a SQL Server contractor/consultant, typically three to six month assignments at companies having "problems with the databases" so I've seen use of SQL Server at many companies. (I am also a mother-in-law, and my son and daughter-in-law have zero interest in programming.) I am responsible for knowledge transfer alongside fixing the problems. The source of many problems is application of a hodgepodge of techniques when straightforward T-SQL scripts referencing linked servers does the job more simply (and with better performance, although that matters less with 64-bit hardware). When a task does not involve file or Windows server operations, why use Powershell? Generally, programmers can maintain others' T-SQL better than they can use and maintain others' Powershell. Maintainability better serves a company than an extra shot of clever programming. It's important that programmers and the companies that employ them remember that SQL is the only language that can access database objects including indexes, however the SQL is contained in another language. So start from inside the database -- the system views -- and use T-SQL to generate SQL.

    declare @srvrs table (srvrName sysname, loopHasProcessed char(1) null)

    insert into @srvrs (srvrName)

    select name from sys.servers

    select 'I can query ' + srvrName

    from @srvrs

    _________________
    "Look, those sheep have been shorn."
    data analyst replies, "On the sides that we can see.."