/ tools / PowerShellTool / commonParameters.ts
commonParameters.ts
 1  /**
 2   * PowerShell Common Parameters (available on all cmdlets via [CmdletBinding()]).
 3   * Source: about_CommonParameters (PowerShell docs) + Get-Command output.
 4   *
 5   * Shared between pathValidation.ts (merges into per-cmdlet known-param sets)
 6   * and readOnlyValidation.ts (merges into safeFlags check). Split out to break
 7   * what would otherwise be an import cycle between those two files.
 8   *
 9   * Stored lowercase with leading dash — callers `.toLowerCase()` their input.
10   */
11  
12  export const COMMON_SWITCHES = ['-verbose', '-debug']
13  
14  export const COMMON_VALUE_PARAMS = [
15    '-erroraction',
16    '-warningaction',
17    '-informationaction',
18    '-progressaction',
19    '-errorvariable',
20    '-warningvariable',
21    '-informationvariable',
22    '-outvariable',
23    '-outbuffer',
24    '-pipelinevariable',
25  ]
26  
27  export const COMMON_PARAMETERS: ReadonlySet<string> = new Set([
28    ...COMMON_SWITCHES,
29    ...COMMON_VALUE_PARAMS,
30  ])