en-GB/PSRule.Monitor-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>Send-PSRuleMonitorRecord</command:name>
      <command:verb>Send</command:verb>
      <command:noun>PSRuleMonitorRecord</command:noun>
      <maml:description>
        <maml:para>Send analysis results from PSRule to Azure Monitor.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>Send analysis results from PSRule as logs into an Azure Monitor Log Analytics workspace.</maml:para>
      <maml:para>Generate analysis results from PSRule by using the Invoke-PSRule cmdlet. Results are automatically batched and inserted as custom log data within the PSRule_CL table.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Send-PSRuleMonitorRecord</maml:name>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
          <maml:name>WorkspaceId</maml:name>
          <maml:description>
            <maml:para>The unique identifier of a Azure Monitor Log Analytics workspace. If not specified, the `PSRULE_CONFIGURATION_MONITOR_WORKSPACE_ID` environment variable is used.</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="1" aliases="none">
          <maml:name>SharedKey</maml:name>
          <maml:description>
            <maml:para>Either the primary or secondary key for the workspace. If not specified, the `PSRULE_CONFIGURATION_MONITOR_WORKSPACE_KEY` environment variable is used.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">SecureString</command:parameterValue>
          <dev:type>
            <maml:name>SecureString</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="2" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:description>
            <maml:para>The analysis record to send to Azure Monitor.</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>LogName</maml:name>
          <maml:description>
            <maml:para>Optionally specifies an alternative data source to store log data into. By default PSRule is used.</maml:para>
            <maml:para>If the log does not already exist, it is created. It can create up to 15 minutes to create the log initially.</maml:para>
            <maml:para>The specified log name will have the _CL suffix appended to it. For example, when the log name is PSRule the use PSRule_CL in log queries.</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>PSRule</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
        <maml:name>WorkspaceId</maml:name>
        <maml:description>
          <maml:para>The unique identifier of a Azure Monitor Log Analytics workspace. If not specified, the `PSRULE_CONFIGURATION_MONITOR_WORKSPACE_ID` environment variable is used.</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="1" aliases="none">
        <maml:name>SharedKey</maml:name>
        <maml:description>
          <maml:para>Either the primary or secondary key for the workspace. If not specified, the `PSRULE_CONFIGURATION_MONITOR_WORKSPACE_KEY` environment variable is used.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">SecureString</command:parameterValue>
        <dev:type>
          <maml:name>SecureString</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>LogName</maml:name>
        <maml:description>
          <maml:para>Optionally specifies an alternative data source to store log data into. By default PSRule is used.</maml:para>
          <maml:para>If the log does not already exist, it is created. It can create up to 15 minutes to create the log initially.</maml:para>
          <maml:para>The specified log name will have the _CL suffix appended to it. For example, when the log name is PSRule the use PSRule_CL in log queries.</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>PSRule</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="2" aliases="none">
        <maml:name>InputObject</maml:name>
        <maml:description>
          <maml:para>The analysis record to send to Azure Monitor.</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:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.Management.Automation.PSObject</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Void</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>$data | Invoke-PSRule | Send-PSRuleMonitorRecord;</dev:code>
        <dev:remarks>
          <maml:para>Send results from the pipeline to Azure Monitor.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 2 --------------------------</maml:title>
        <dev:code>Get-Content .\output.json -Raw | ConvertFrom-Json | Send-PSRuleMonitorRecord;</dev:code>
        <dev:remarks>
          <maml:para>Send results from disk to Azure Monitor.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 3 --------------------------</maml:title>
        <dev:code>$results = Invoke-PSRule -InputPath .\*.json -Module 'PSRule.Rules.Azure';
$results | Send-PSRuleMonitorRecord -WorkspaceId &lt;workspaceId&gt; -SharedKey &lt;primaryKey&gt;;</dev:code>
        <dev:remarks>
          <maml:para>Send results from a variable to Azure Monitor.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version:</maml:linkText>
        <maml:uri>https://github.com/Microsoft/PSRule.Monitor/blob/main/docs/commands/PSRule.Monitor/en-US/Send-PSRuleMonitorRecord.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>