en-US/CompleterActions-help.xml
|
<?xml version="1.0" encoding="utf-8"?> <helpItems xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" schema="maml" xmlns="http://msh"> <command:command> <command:details> <command:name>Get-CompleterRegistration</command:name> <maml:description> <maml:para>Gets completer registrations known to the module or discovered at runtime.</maml:para> </maml:description> <command:verb>Get</command:verb> <command:noun>CompleterRegistration</command:noun> </command:details> <maml:description> <maml:para>Returns completer registration records for all registrations, specific registration keys, native command completers, or command parameter completers. By default the command merges module-managed registrations with runtime-discovered registrations and prefers the managed record when both refer to the same target and the managed record still matches the live runtime value. When the runtime registration was replaced outside this module, the live discovered value is returned with State 'Conflicted' instead; -ManagedOnly returns the managed record with State 'Stale'. When the runtime registration was removed outside this module, the managed record is returned with State 'Stale' and IsRuntimeRegistered false. The command accepts arrays for key, command, and parameter lookup scenarios and supports property-name pipeline binding for key-based and target-based lookups.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-CompleterRegistration</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ManagedOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>DiscoveredOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>IncludeTotalCount</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Skip</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>First</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="RegistrationKey"> <maml:name>Key</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ManagedOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>DiscoveredOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>IncludeTotalCount</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Skip</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>First</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ManagedOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>DiscoveredOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>IncludeTotalCount</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Skip</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>First</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Native</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ManagedOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>DiscoveredOnly</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>IncludeTotalCount</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Skip</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>First</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">ulong</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description> <maml:para>Limits results to one or more command names for native or command-parameter completers.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>DiscoveredOnly</maml:name> <maml:description> <maml:para>Returns only registrations discovered from the current PowerShell runtime.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>First</maml:name> <maml:description> <maml:para /> </maml:description> <command:parameterValue required="true" variableLength="true">System.UInt64</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>IncludeTotalCount</maml:name> <maml:description> <maml:para /> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="RegistrationKey"> <maml:name>Key</maml:name> <maml:description> <maml:para>Gets the registrations that match one or more registration keys.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>ManagedOnly</maml:name> <maml:description> <maml:para>Returns only registrations tracked by this module.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="IsNative"> <maml:name>Native</maml:name> <maml:description> <maml:para>Indicates that the lookup target is a native command completer instead of a command parameter completer.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description> <maml:para>Limits results to one or more parameter completer targets.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>Skip</maml:name> <maml:description> <maml:para /> </maml:description> <command:parameterValue required="true" variableLength="true">System.UInt64</command:parameterValue> <dev:type> <maml:name>System.UInt64</maml:name> </dev:type> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSCustomObject</maml:name> </dev:type> <maml:description> <maml:para>Returns CompleterActions.CompleterRegistration records.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para /> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- EXAMPLE 1 ---------</maml:title> <maml:introduction> <maml:para>Get-CompleterRegistration -CommandName 'git' -Native</maml:para> <maml:para>€</maml:para> <maml:para>Gets the registration record for the native completer currently associated with git.</maml:para> </maml:introduction> <dev:code /> <dev:remarks /> </command:example> <command:example> <maml:title>--------- EXAMPLE 2 ---------</maml:title> <maml:introduction> <maml:para>Get-CompleterRegistration -Key 'git:checkout', 'git:branch'</maml:para> <maml:para>€</maml:para> <maml:para>Gets multiple completer registrations by key in a single call.</maml:para> </maml:introduction> <dev:code /> <dev:remarks /> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>text</maml:linkText> <maml:uri>https://github.com/tstager/CompleterActions/blob/deae4ca162751c60861237e1d2825f9b0f1fd0ff/src/docs/CompleterActions/Get-CompleterRegistration.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command> <command:details> <command:name>Import-CompleterScript</command:name> <maml:description> <maml:para>Imports self-contained completer scripts into registration input objects.</maml:para> </maml:description> <command:verb>Import</command:verb> <command:noun>CompleterScript</command:noun> </command:details> <maml:description> <maml:para>Parses and validates one or more completer scripts, executes them inside a temporary module that shadows `Register-ArgumentCompleter`, and emits objects that can be piped directly to `Register-CompleterRegistration -InputObject`. Supported scripts must be self-contained and must use literal `Register-ArgumentCompleter` arguments for the target metadata and script block. Imported script blocks preserve the temporary module context that contains any helper functions and script-scope state defined by the source script. ## COMPATIBLE COMPLETER SCRIPT SPECIFICATION Write standalone completer scripts to this specification if you want them to remain importable through `Import-CompleterScript` without redesign: - Keep the script self-contained. Do not dot-source other scripts, and do not use `#requires -Modules`, `#requires -Assembly`, `using module`, or `using assembly`; they load code when the script is dot-sourced. - Keep script scope limited to: - `Set-StrictMode` - function definitions - importer-safe `if` statements - script-scope `Register-ArgumentCompleter` calls - Do not use top-level assignments, loops, `try`/`catch`, alias bootstrap, cache initialization, generated completion loading, or external command execution. - Register completers directly with the built-in `Register-ArgumentCompleter`; do not wrap registration in custom helper functions. - Use only these `Register-ArgumentCompleter` parameters: - `-CommandName` - `-ParameterName` - bare `-Native` - `-ScriptBlock` - Use explicit parameter names only. Positional registration arguments and argument splatting are not supported. - Keep target metadata literal: - `-CommandName` and `-ParameterName` may be a single literal string - a literal string array - or a literal `@('name', 'name.exe')` array expression - Keep `-ScriptBlock` literal. - Keep `Register-ArgumentCompleter` calls at script scope, not inside nested functions or nested script blocks. - Move alias bootstrap, cache initialization, generated completion loading, and other setup into lazy, idempotent helper paths reached from the registered completion script block.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Import-CompleterScript</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-CompleterScript</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:description> <maml:para>One or more literal paths to completer script files. Wildcards are not expanded.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description> <maml:para>One or more paths to completer script files. Wildcards are supported.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSCustomObject</maml:name> </dev:type> <maml:description> <maml:para>Returns `CompleterActions.ImportedCompleterRegistration` records compatible with `Register-CompleterRegistration -InputObject`.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Importer compatibility and runtime correctness are both required for future standalone completer scripts. Validate both the real `pwsh -NoProfile` completion behavior and the script's `Import-CompleterScript` compatibility before treating a completer as complete.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- EXAMPLE 1 ---------</maml:title> <maml:introduction> <maml:para>```PowerShell Import-CompleterScript -Path .\7z_completer.ps1 | Register-CompleterRegistration -PassThru ```</maml:para> <maml:para>€</maml:para> <maml:para>Imports a supported completer script and registers the imported definitions through the module's managed registration API.</maml:para> </maml:introduction> <dev:code /> <dev:remarks /> </command:example> <command:example> <maml:title>--------- EXAMPLE 2 ---------</maml:title> <maml:introduction> <maml:para>```PowerShell Register-ArgumentCompleter -Native -CommandName @('tool', 'tool.exe') -ScriptBlock { param($wordToComplete, $commandAst, $cursorPosition) Complete-Tool -WordToComplete $wordToComplete -CommandAst $commandAst -CursorPosition $cursorPosition } ```</maml:para> <maml:para>€</maml:para> <maml:para>This is the preferred registration shape for an import-compatible native completer. Keep setup logic in helper functions that run from `Complete-Tool` rather than at script scope.</maml:para> </maml:introduction> <dev:code /> <dev:remarks /> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>text</maml:linkText> <maml:uri>https://github.com/tstager/CompleterActions/blob/deae4ca162751c60861237e1d2825f9b0f1fd0ff/src/docs/CompleterActions/Import-CompleterScript.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command> <command:details> <command:name>Register-CompleterRegistration</command:name> <maml:description> <maml:para>Registers a managed PowerShell argument completer.</maml:para> </maml:description> <command:verb>Register</command:verb> <command:noun>CompleterRegistration</command:noun> </command:details> <maml:description> <maml:para>Registers native or command-parameter argument completers with Register-ArgumentCompleter and records the registrations in the module's managed state. Existing managed or runtime registrations are preserved unless you use -Force to replace them. Registering the same script for a target that is already managed is idempotent only while the managed record still matches the live runtime value; when the runtime registration was replaced or removed outside this module, the managed record is stale and the command fails until you reconcile it with -Force. Each target is updated transactionally: if the runtime or managed write fails, the previous runtime and managed state are restored and any rollback failure is reported alongside the original error. The command supports array inputs for command and parameter targets, and it can also accept pipeline InputObject values that describe the target and expose a ScriptBlock property.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Register-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">scriptblock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Register-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">psobject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Register-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Native</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">scriptblock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description> <maml:para>Specifies one or more command names whose completers should be registered.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>Force</maml:name> <maml:description> <maml:para>Removes an existing managed or runtime registration for the same target before registering the new completer.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="Named" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>Supplies one or more objects that describe completer targets. Input objects must expose target metadata through Key, RegistrationKey, RuntimeKey, or CommandName/ParameterName plus IsNative/Native, and must expose a ScriptBlock property whose value is a script block.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.Management.Automation.PSObject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="IsNative"> <maml:name>Native</maml:name> <maml:description> <maml:para>Registers native completers for the commands instead of parameter completers.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description> <maml:para>Specifies one or more parameter names for command-parameter completer registrations.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>Returns the managed registration records that were created or reused.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:description> <maml:para>Provides the completer script block to register. When multiple targets are supplied through arrays, the same script block is reused for each target.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Runs the command in a mode that only reports what would happen without performing the actions.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSCustomObject</maml:name> </dev:type> <maml:description> <maml:para>When -PassThru is used</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para /> </maml:alert> </maml:alertSet> <command:examples /> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>text</maml:linkText> <maml:uri>https://github.com/tstager/CompleterActions/blob/deae4ca162751c60861237e1d2825f9b0f1fd0ff/src/docs/CompleterActions/Register-CompleterRegistration.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command> <command:details> <command:name>Unregister-CompleterRegistration</command:name> <maml:description> <maml:para>Removes completer registrations from runtime and, when applicable, module state.</maml:para> </maml:description> <command:verb>Unregister</command:verb> <command:noun>CompleterRegistration</command:noun> </command:details> <maml:description> <maml:para>Removes completer registrations identified by registration key, native command, command parameter target, or pipeline InputObject values. Managed registrations are removed from both the PowerShell runtime and the module's registration table. Runtime-only registrations require -AllowUnmanaged before they can be removed. The same gate applies when a managed record is stale because the runtime registration was replaced outside this module: the live value is only removed with -AllowUnmanaged, and the stale managed record is dropped with it. When the runtime registration was already removed outside this module, only the stale managed record remains and it is removed without the gate. The command supports array inputs for keys and target fields, plus pipeline input from Get-CompleterRegistration output.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Unregister-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="RegistrationKey"> <maml:name>Key</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>AllowUnmanaged</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Unregister-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">psobject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>AllowUnmanaged</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Unregister-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>AllowUnmanaged</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Unregister-CompleterRegistration</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description /> <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Native</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>AllowUnmanaged</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>WhatIf</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none"> <maml:name>Confirm</maml:name> <maml:description /> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>AllowUnmanaged</maml:name> <maml:description> <maml:para>Allows removal of runtime registrations that are not tracked by this module.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>CommandName</maml:name> <maml:description> <maml:para>Specifies one or more command names whose completers should be removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="Named" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>Supplies one or more objects that describe registrations to remove. Input objects can expose Key, RegistrationKey, RuntimeKey, or CommandName/ParameterName plus IsNative/Native.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.Management.Automation.PSObject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="RegistrationKey"> <maml:name>Key</maml:name> <maml:description> <maml:para>Removes the registrations that match one or more registration keys.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="IsNative"> <maml:name>Native</maml:name> <maml:description> <maml:para>Targets native completer registrations instead of command parameter completers.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="Named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:description> <maml:para>Specifies one or more parameter names for command-parameter completer removal targets.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>Returns the registration records that were removed.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Runs the command in a mode that only reports what would happen without performing the actions.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSCustomObject</maml:name> </dev:type> <maml:description> <maml:para>When -PassThru is used</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para /> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para /> </maml:alert> </maml:alertSet> <command:examples /> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>text</maml:linkText> <maml:uri>https://github.com/tstager/CompleterActions/blob/deae4ca162751c60861237e1d2825f9b0f1fd0ff/src/docs/CompleterActions/Unregister-CompleterRegistration.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |