en-US/PowerShell.MCP.dll-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Add-LinesToFile</command:name>
      <command:verb>Add</command:verb>
      <command:noun>LinesToFile</command:noun>
      <maml:description>
        <maml:para>Insert lines into a text file at a specific position or at the end</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Add-LinesToFile</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- Omitting `-LineNumber` appends to end</maml:para>
        <maml:para>- `-LineNumber 1` inserts at beginning</maml:para>
        <maml:para>- For new files, `-LineNumber` only accepts 1</maml:para>
        <maml:para>- Wildcards cannot create new files</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Add-LinesToFile file.txt -Content "new line" # append to end
Add-LinesToFile file.txt -LineNumber 5 -Content "inserted" # insert at line 5 (existing lines shift down)
Add-LinesToFile file.txt -Content @("line1", "line2") # add multiple lines
Add-LinesToFile new.txt -Content "first line" # create new file</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Get-MCPProxyPath</command:name>
      <command:verb>Get</command:verb>
      <command:noun>MCPProxyPath</command:noun>
      <maml:description>
        <maml:para>Gets the path to the PowerShell.MCP.Proxy executable for the current platform.</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Get-MCPProxyPath</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- `-Escape` doubles backslashes for JSON config files</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Get-MCPProxyPath # C:\...\PowerShell.MCP.Proxy.exe
Get-MCPProxyPath -Escape # C:\\...\\PowerShell.MCP.Proxy.exe (for JSON)</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Remove-LinesFromFile</command:name>
      <command:verb>Remove</command:verb>
      <command:noun>LinesFromFile</command:noun>
      <maml:description>
        <maml:para>Remove lines from a text file by line range or pattern matching</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Remove-LinesFromFile</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- At least one of `-LineRange`, `-Contains`, or `-Pattern` required</maml:para>
        <maml:para>- `-Contains` and `-Pattern` are mutually exclusive</maml:para>
        <maml:para>- `-LineRange` + `-Pattern`/`-Contains` = AND condition</maml:para>
        <maml:para>- Use `-WhatIf` to preview deletions</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Remove-LinesFromFile file.txt -LineRange 5,10 # remove lines 5-10
Remove-LinesFromFile file.txt -LineRange -10 # remove last 10 lines
Remove-LinesFromFile file.txt -Pattern "^#" # remove all comment lines
Remove-LinesFromFile file.txt -Contains "DEBUG" # remove lines containing "DEBUG"
Remove-LinesFromFile file.txt -LineRange 1,100 -Pattern "TODO" # remove TODO lines within range (AND)</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Show-TextFile</command:name>
      <command:verb>Show</command:verb>
      <command:noun>TextFile</command:noun>
      <maml:description>
        <maml:para>Display text file contents with line numbers</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Show-TextFile</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- `-LiteralPath` for paths with `[`, `]`, `*`, `?` (all file cmdlets support this)</maml:para>
        <maml:para>- `-LineRange -10` = last 10 lines (single negative value = tail)</maml:para>
        <maml:para>- `-Contains` and `-Pattern` can be combined (OR condition)</maml:para>
        <maml:para>- `-Recurse` requires `-Pattern` or `-Contains`</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Show-TextFile file.txt # entire file
Show-TextFile file.txt -LineRange 10,20 # lines 10-20
Show-TextFile file.txt -LineRange -10 # last 10 lines
Show-TextFile file.txt -Pattern "error" # regex search with 2-line context
Show-TextFile file.txt -Contains "[Error]" # literal search (no escaping needed)
Show-TextFile . -Recurse -Pattern "TODO" # recursive directory search</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Update-LinesInFile</command:name>
      <command:verb>Update</command:verb>
      <command:noun>LinesInFile</command:noun>
      <maml:description>
        <maml:para>Replace or delete specific lines in a text file</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Update-LinesInFile</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- `-Content @()` deletes lines (empty array)</maml:para>
        <maml:para>- Omitting `-LineRange` replaces entire file</maml:para>
        <maml:para>- `-Content` is required when `-LineRange` is specified</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Update-LinesInFile file.txt -LineRange 5 -Content "replaced" # replace line 5
Update-LinesInFile file.txt -LineRange 5,10 -Content "single line" # replace lines 5-10 with one line
Update-LinesInFile file.txt -LineRange 5,10 -Content @() # delete lines 5-10
Update-LinesInFile file.txt -Content @("line1", "line2") # replace entire file</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
  <command:command 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" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Update-MatchInFile</command:name>
      <command:verb>Update</command:verb>
      <command:noun>MatchInFile</command:noun>
      <maml:description>
        <maml:para>Replace text in a file using literal string or regex pattern</maml:para>
      </maml:description>
    </command:details>
    <maml:description />
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Update-MatchInFile</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>- `-OldText` (literal) and `-Pattern` (regex) are mutually exclusive</maml:para>
        <maml:para>- `-Pattern` supports capture groups (`$1`, `$2`) in `-Replacement`</maml:para>
        <maml:para>- Use here-strings (@'...'@) for code with special characters ($, {}, quotes)</maml:para>
        <maml:para>- `-WhatIf` shows detailed preview with highlighting</maml:para>
        <maml:para>- Newlines in `-Replacement` are normalized to match file's newline style</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------- Example 1: Basic usage --------------------</maml:title>
        <dev:code>Update-MatchInFile file.txt -OldText "foo" -Replacement "bar" # literal replacement
Update-MatchInFile file.txt -Pattern "v\d+" -Replacement "v2" # regex replacement
Update-MatchInFile file.cs -Pattern "(\w+)\.Log" -Replacement '$1.Debug' # with capture group
Update-MatchInFile file.txt -LineRange 10,20 -OldText "old" -Replacement "new" # within range</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
</helpItems>