en-US/Sanitization-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>Invoke-FileRedaction</command:name>
      <command:verb>Invoke</command:verb>
      <command:noun>FileRedaction</command:noun>
      <maml:description>
        <maml:para>Redact sensitive information from a file</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>Redact sensitive information from a file as an array of strings or one long string by defined redaction rules.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Invoke-FileRedaction</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>RedactionRule</maml:name>
          <maml:Description>
            <maml:para>Array of rules to redact by.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">RedactionRule[]</command:parameterValue>
          <dev:type>
            <maml:name>RedactionRule[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="2" aliases="none">
          <maml:name>Path</maml:name>
          <maml:Description>
            <maml:para>Specifies a path to one or more locations.
Wildcards are permitted.
</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
          <dev:type>
            <maml:name>String[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>ReadRaw</maml:name>
          <maml:Description>
            <maml:para>Ignores newline characters and pass the entire contents of a file in one string with the newlines preserved.
By default, newline characters in a file are used as delimiters to separate the input into an array of strings.
Process the file as one string instead of processing the strings line by line.</maml:para>
          </maml:Description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>Invoke-FileRedaction</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>RedactionRule</maml:name>
          <maml:Description>
            <maml:para>Array of rules to redact by.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">RedactionRule[]</command:parameterValue>
          <dev:type>
            <maml:name>RedactionRule[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="2" aliases="PSPath">
          <maml:name>LiteralPath</maml:name>
          <maml:Description>
            <maml:para>Specifies a path to one or more locations.
Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as it is typed.
No characters are interpreted as wildcards.
If the path includes escape characters, enclose it in single quotation marks.
Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.
</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
          <dev:type>
            <maml:name>String[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>ReadRaw</maml:name>
          <maml:Description>
            <maml:para>Ignores newline characters and pass the entire contents of a file in one string with the newlines preserved.
By default, newline characters in a file are used as delimiters to separate the input into an array of strings.
Process the file as one string instead of processing the strings line by line.</maml:para>
          </maml:Description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>RedactionRule</maml:name>
        <maml:Description>
          <maml:para>Array of rules to redact by.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">RedactionRule[]</command:parameterValue>
        <dev:type>
          <maml:name>RedactionRule[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="2" aliases="none">
        <maml:name>Path</maml:name>
        <maml:Description>
          <maml:para>Specifies a path to one or more locations.
Wildcards are permitted.
</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
        <dev:type>
          <maml:name>String[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="2" aliases="PSPath">
        <maml:name>LiteralPath</maml:name>
        <maml:Description>
          <maml:para>Specifies a path to one or more locations.
Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as it is typed.
No characters are interpreted as wildcards.
If the path includes escape characters, enclose it in single quotation marks.
Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.
</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
        <dev:type>
          <maml:name>String[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>ReadRaw</maml:name>
        <maml:Description>
          <maml:para>Ignores newline characters and pass the entire contents of a file in one string with the newlines preserved.
By default, newline characters in a file are used as delimiters to separate the input into an array of strings.
Process the file as one string instead of processing the strings line by line.</maml:para>
        </maml:Description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para>Invoke-RedactionRule creates 2 files in the same location of the input file.
The redacted file with "-Sanitized.txt" suffix and the conversion table csv file with "-ConversionTable.csv" suffix.
By default all strings in the files are processed with Invoke-Redaction with the -Consistent parameter.</maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>$WULog = "$env:USERPROFILE\Desktop\WULog.log"
Get-WindowsUpdateLog -LogPath $WULog
Invoke-FileRedaction -Path $WULog -ReadRaw -RedactionRule @(
    New-RedactionRule '(?&lt;=\d{4}\/\d{2}\/\d{2} \d{2}\:\d{2}\:\d{2}\.\d{7} \d{1,5} \d{1,5}\s+)\w+(?=\s+)' 'Component_{0}'
)</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>Invoke-Redaction</command:name>
      <command:verb>Invoke</command:verb>
      <command:noun>Redaction</command:noun>
      <maml:description>
        <maml:para>Redact sensitive information from an object</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>Redact sensitive information from an object as string by defined redaction rules</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Invoke-Redaction</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>RedactionRule</maml:name>
          <maml:Description>
            <maml:para>Array of redaction rules to redact by</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">RedactionRule[]</command:parameterValue>
          <dev:type>
            <maml:name>RedactionRule[]</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="2" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:Description>
            <maml:para>String to redact sensitive information from</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
          <dev:type>
            <maml:name>PSObject</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>Consistent</maml:name>
          <maml:Description>
            <maml:para>Saves discovered values in a ConversionTable (hash table), when the same values disceverd again they are replaced with the same string that was generated the first time from the redaction rule NewValue function or NewValue formatted string. It uses a uniqueness value to generate new value from the redaction rule (if applicable). if Consistent is ommitted generation of new value from redaction rule's NewValues is based on current line number.</maml:para>
          </maml:Description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>OutConversionTable</maml:name>
          <maml:Description>
            <maml:para>Creates a variable with the specified name and the ConversionTable as its value.
Dynamic parameter, available only when `-Consistant` is on.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>AsObject</maml:name>
          <maml:Description>
            <maml:para>Return an object with the old string, the processed string, line number and if the string was changed or not instead of just a processed string.</maml:para>
          </maml:Description>
          <dev:type>
            <maml:name>SwitchParameter</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>False</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>TotalLines</maml:name>
          <maml:Description>
            <maml:para>Number of lines that are going to be processed over the pipeline. Relevant for showing informative progress bar.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
          <dev:type>
            <maml:name>Int32</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>1</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>RedactionRule</maml:name>
        <maml:Description>
          <maml:para>Array of redaction rules to redact by</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">RedactionRule[]</command:parameterValue>
        <dev:type>
          <maml:name>RedactionRule[]</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="2" aliases="none">
        <maml:name>InputObject</maml:name>
        <maml:Description>
          <maml:para>String to redact sensitive information from</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
        <dev:type>
          <maml:name>PSObject</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>Consistent</maml:name>
        <maml:Description>
          <maml:para>Saves discovered values in a ConversionTable (hash table), when the same values disceverd again they are replaced with the same string that was generated the first time from the redaction rule NewValue function or NewValue formatted string. It uses a uniqueness value to generate new value from the redaction rule (if applicable). if Consistent is ommitted generation of new value from redaction rule's NewValues is based on current line number.</maml:para>
        </maml:Description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>OutConversionTable</maml:name>
        <maml:Description>
          <maml:para>Creates a variable with the specified name and the ConversionTable as its value.
Dynamic parameter, available only when `-Consistant` is on.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>AsObject</maml:name>
        <maml:Description>
          <maml:para>Return an object with the old string, the processed string, line number and if the string was changed or not instead of just a processed string.</maml:para>
        </maml:Description>
        <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
        <dev:type>
          <maml:name>SwitchParameter</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>False</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>TotalLines</maml:name>
        <maml:Description>
          <maml:para>Number of lines that are going to be processed over the pipeline. Relevant for showing informative progress bar.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
        <dev:type>
          <maml:name>Int32</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>1</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>$RedactionRule = New-RedactionRule -Pattern '[a-z]' -NewValueString '+'
ipconfig /all | Invoke-Redaction -RedactionRule $RedactionRule</dev:code>
        <dev:remarks>
          <maml:para>Replace all a-z letters with '+' sign.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
        <dev:code>$RedactionRule = New-RedactionRule -Pattern '(?&lt;=\s)[Ss].+' -NewValueString 's_{0}'
Get-Process | Out-String | Invoke-Redaction -RedactionRule $RedactionRule -Consistent</dev:code>
        <dev:remarks>
          <maml:para>Replace all service names that start with the letter 's' with 's_{0}', where {0} is replaced by uniqueness factor. Each unique serivce name will be replaced with a unique new value 's_{0}' and it will stay consistent if the service shows up multiple times.</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>New-RedactionRule</command:name>
      <command:verb>New</command:verb>
      <command:noun>RedactionRule</command:noun>
      <maml:description>
        <maml:para>Creates new redaction rule.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>Creates new redaction rule with regex pattern to look for and NewValue to replace with.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>New-RedactionRule</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>Pattern</maml:name>
          <maml:Description>
            <maml:para>Regex pattern</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
          <maml:name>NewValueFunction</maml:name>
          <maml:Description>
            <maml:para>Script block to generate new generic data, the result is then put instead of the original value. This script block can accept at most 1 int parameter with $args[0] or declare variable in param() block</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
          <dev:type>
            <maml:name>ScriptBlock</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>New-RedactionRule</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>Pattern</maml:name>
          <maml:Description>
            <maml:para>Regex pattern</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
          <maml:name>NewValueString</maml:name>
          <maml:Description>
            <maml:para>String value to be replaced instead of pattern. The string can contain place holder {0}, and it will be replaced with uniqueness factor.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>New-RedactionRule</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
          <maml:name>CommonRule</maml:name>
          <maml:Description>
            <maml:para>Predefined rules - patterns and values</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>Pattern</maml:name>
        <maml:Description>
          <maml:para>Regex pattern</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
        <maml:name>NewValueFunction</maml:name>
        <maml:Description>
          <maml:para>Script block to generate new generic data, the result is then put instead of the original value. This script block can accept at most 1 int parameter with $args[0] or declare variable in param() block</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
        <dev:type>
          <maml:name>ScriptBlock</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
        <maml:name>NewValueString</maml:name>
        <maml:Description>
          <maml:para>String value to be replaced instead of pattern. The string can contain place holder {0}, and it will be replaced with uniqueness factor.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>CommonRule</maml:name>
        <maml:Description>
          <maml:para>Predefined rules - patterns and values</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes />
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>RedactionRule</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>PS&gt; New-RedactionRule '(?&lt;=\().*(?=\))' 'Process_{0}'
 
Pattern NewValueFunction NewValueString Type
------- ---------------- -------------- ----
(?&lt;=\().*(?=\)) Process_{0} String</dev:code>
        <dev:remarks>
          <maml:para>Creating redaction rule with new-value-string using positional parameters.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
        <dev:code>PS&gt; Mark '[a-z]' {
    [long]$p = $args[0]
    [char]($p % 26 + 65)
}
 
Pattern NewValueFunction NewValueString Type
------- ---------------- -------------- ----
[a-z] [long]$p = $args[0]; [char]($p % 26 + 65) Function</dev:code>
        <dev:remarks>
          <maml:para>The call to create new redaction rule is made with the alias `Mark` instead of `New-RedactionRule`. Creating redaction rule with new-value-function using positional parameters.
Scriptblock is detected automatically and assigned to `-NewValueFunction` parameter.
The script block accepts one number parameter/argument:</maml:para>
          <maml:para>- When `-Consistent` is used in Invoke-Redaction - The argument is populated with uniquness value.</maml:para>
          <maml:para>- and when `-Consistent` is not used in Invoke-Redaction - The argument is populated with the current line number.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
        <dev:code>PS&gt; $IPRule = Mark -CommonRule IPV4Address
PS&gt; $IPRule.Pattern
\b(\d{1,3}(\.\d{1,3}){3})\b
PS&gt; $IPRule.NewValueFunction
 
    [int]$t = $args[0]
 
    $o4 = ($t % 254) + 1
    $t = $t / 254
    $o3 = $t % 254
    $t = $t / 254
    $o2 = $t % 254
    $t = $t / 254
    $o1 = $t % 254 + 11
 
    "$o1.$o2.$o3.$o4"</dev:code>
        <dev:remarks>
          <maml:para>Create a rule with predefined definition or pattern and new value (function) to obfuscate an IP address.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
</helpItems>