dbatools: Command for GitHub Copilot

.github/prompts/pipeline-output.md

pipeline-output is a command for GitHub Copilot from dataplat/dbatools. It costs 0 tokens per session (818 once invoked), scanned A, original, MIT.

A guide for PowerShell commands that send each result to the pipeline as soon as it is created. A pipeline passes command output to another command or to the user.

In plain words
What is it for?
Use it when writing commands that process many SQL Server instances or databases and should stream results, support chaining, or preserve partial output after an error.
Why use it?
It avoids holding all results in an array, which can use more memory and delays visible output. It also allows later commands to process results as they arrive.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

This is dataplat/dbatools's own configuration. It tells GitHub Copilot how to work on dbatools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dbatools configures →

About the project

dbatools is a PowerShell toolkit for automating SQL Server administration and moving SQL Server instances between environments. It is for database administrators who manage SQL Server systems and migrations.

dataplat/dbatools · 2,858 stars · on GitHub · dbatools.io

Reuse

Borrowing it

Nothing to install: this file belongs to dataplat/dbatools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dataplat/dbatools/development/.github/prompts/pipeline-output.md
Clone the repo
git clone --depth 1 https://github.com/dataplat/dbatools

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pipeline-output

README.md
[![agentmods](https://agentmods.dev/badge/commands/dataplat/dbatools/pipeline-output/github.svg)](https://agentmods.dev/commands/dataplat/dbatools/pipeline-output)
Your own site
<a href="https://agentmods.dev/commands/dataplat/dbatools/pipeline-output"><img src="https://agentmods.dev/badge/commands/dataplat/dbatools/pipeline-output/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pipeline-output

Your own site · 80×15
<a href="https://agentmods.dev/commands/dataplat/dbatools/pipeline-output"><img src="https://agentmods.dev/badge/commands/dataplat/dbatools/pipeline-output.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 818 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00818
Opus 5.5 $0.00000 $0.00327
Sonnet 5.5 $0.00000 $0.00164
Haiku 4.5 $0.00000 $0.00082

Measured 1mo ago against content hash 2445d0785e84, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pipeline-output scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/pipeline-output.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pipeline Output Patterns

CRITICAL RULE: NEVER collect objects in an ArrayList or array and output them at the end. Output objects to the pipeline immediately as they are created.

Why Immediate Output

  • Memory Efficiency: Objects are released to the pipeline immediately, not held in memory
  • User Experience: Users see results streaming in real-time, not waiting until the end
  • Pipeline Compatibility: Enables proper pipeline chaining and early termination (Ctrl+C)
  • Error Resilience: Partial results are available even if the command fails partway through

Correct Pattern - Output Immediately

foreach ($instance in $SqlInstance) {
    $server = Connect-DbaInstance -SqlInstance $instance -SqlCredential $SqlCredential

    foreach ($db in $server.Databases) {
        # Output each object immediately to the pipeline
        [PSCustomObject]@{
            ComputerName = $server.ComputerName
            InstanceName = $server.ServiceName
            SqlInstance  = $server.DomainInstanceName
            Database     = $db.Name
            Size         = $db.Size
        }
    }
}

Wrong Patterns - DO NOT USE

ArrayList Collection (OLD PATTERN)

# WRONG - This is an outdated anti-pattern
$results = New-Object System.Collections.ArrayList

foreach ($instance in $SqlInstance) {
    $server = Connect-DbaInstance -SqlInstance $instance -SqlCredential $SqlCredential

    foreach ($db in $server.Databases) {
        $null = $results.Add([PSCustomObject]@{
            ComputerName = $server.ComputerName
            Database     = $db.Name
        })
    }
}

# WRONG - Holding everything until the end
$results

Array Concatenation (Worst Performance)

# WRONG - Array concatenation is extremely slow
$results = @()

foreach ($db in $databases) {
    $results += [PSCustomObject]@{
        Name = $db.Name
    }
}

$results

No -Detailed or -Simple Parameters

Do NOT create -Detailed or -Simple switch parameters that change the output object structure. This is an outdated pattern that creates confusion and breaks pipeline expectations.

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 127 lines · 0 tokens per session scan A 2445d0785e84

Subscribe to this mod's changes

pipeline-output is a command published in the GitHub repository dataplat/dbatools (2,858 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 818 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.

Related

pipeline-output compared with commands from other repositories

pipeline-output next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pipeline-outputdataplat/dbatoolsCommand2.9k4d agoMITA0GitHub Copilot
rust-developerhmohamed01/claude-code-pluginsCommand71mo agononeA22Claude Code
generate-typesHKTITAN/cursor-best-practicesCommand78mo agoMITA0Claude Code
auditofershap/go-best-practicesCommand28mo agoMITA12Claude Code
auditofershap/python-best-practicesCommand18mo agoMITA12Claude Code
triagejuan294/cc-rpiCommand53d agoMITA0Claude Code
azure-graph-dotnet:deploy-azureTheLobbi/Claude-mCommand181mo agononeA57Claude Code