πŸ“„ File detail

tools/PowerShellTool/commonParameters.ts

🧩 .tsπŸ“ 31 linesπŸ’Ύ 894 bytesπŸ“ text
← Back to All Files

🎯 Use case

This module implements the β€œPowerShellTool” tool (Power Shell) β€” something the model can call at runtime alongside other agent tools. On the API surface it exposes COMMON_SWITCHES, COMMON_VALUE_PARAMS, and COMMON_PARAMETERS β€” mainly types, interfaces, or factory objects. What the file header says: PowerShell Common Parameters (available on all cmdlets via [CmdletBinding()]). Source: about_CommonParameters (PowerShell docs) + Get-Command output. Shared between pathValidation.ts (merges into per-cmdlet known-param sets) and readOnlyValidation.ts (merges into safeFlags check).

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

PowerShell Common Parameters (available on all cmdlets via [CmdletBinding()]). Source: about_CommonParameters (PowerShell docs) + Get-Command output. Shared between pathValidation.ts (merges into per-cmdlet known-param sets) and readOnlyValidation.ts (merges into safeFlags check). Split out to break what would otherwise be an import cycle between those two files. Stored lowercase with leading dash β€” callers `.toLowerCase()` their input.

πŸ“€ Exports (heuristic)

  • COMMON_SWITCHES
  • COMMON_VALUE_PARAMS
  • COMMON_PARAMETERS

πŸ–₯️ Source preview

/**
 * PowerShell Common Parameters (available on all cmdlets via [CmdletBinding()]).
 * Source: about_CommonParameters (PowerShell docs) + Get-Command output.
 *
 * Shared between pathValidation.ts (merges into per-cmdlet known-param sets)
 * and readOnlyValidation.ts (merges into safeFlags check). Split out to break
 * what would otherwise be an import cycle between those two files.
 *
 * Stored lowercase with leading dash β€” callers `.toLowerCase()` their input.
 */

export const COMMON_SWITCHES = ['-verbose', '-debug']

export const COMMON_VALUE_PARAMS = [
  '-erroraction',
  '-warningaction',
  '-informationaction',
  '-progressaction',
  '-errorvariable',
  '-warningvariable',
  '-informationvariable',
  '-outvariable',
  '-outbuffer',
  '-pipelinevariable',
]

export const COMMON_PARAMETERS: ReadonlySet<string> = new Set([
  ...COMMON_SWITCHES,
  ...COMMON_VALUE_PARAMS,
])