en-US/New-MamlDocument.xml

<?xml version = "1.0" encoding = "utf-8" ?>
<helpItems schema="maml">
    <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-MamlDocument</command:name>
            <maml:description>
                <maml:para>The Export-Counter cmdlet takes PerformanceCounterSampleSet objects and exports them as counter log files.</maml:para>
            </maml:description>
            <maml:copyright><maml:para /></maml:copyright>
            <command:verb>Export</command:verb>
            <command:noun>Counter</command:noun>
            <dev:version />
        </command:details>
        <maml:description>
            <maml:para>The Export-Counter cmdlet exports performance counter data (PerformanceCounterSampleSet objects) to log files in binary performance log (.blg), comma-separated value (.csv), or tab-separated value (.tsv) format. You can use this cmdlet to log or relog performance counter data.</maml:para>
            <maml:para>Export-Counter is designed to export data that is returned by the Get-Counter and Import-Counter cmdlets.</maml:para>
            <maml:para>Note: Export-Counter runs only on Windows 7, Windows Server 2008 R2, and later versions of Windows.</maml:para>
        </maml:description>
        <command:syntax>
            <command:syntaxItem>
                <maml:name>Export-Counter</maml:name>
                <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="1" aliases="">
                    <maml:name>Path</maml:name>
                    <maml:description>
                        <maml:para>Specifies the path and file name of the output file. Enter a relative or absolute path on the local computer, or a Uniform Naming Convention (UNC) path to a remote computer, such as \\Computer\Share\file.blg. This parameter is required.</maml:para>
                        <maml:para>Note: The file format is determined by the value of the FileFormat parameter, not by the file name extension in the path.</maml:para>
                    </maml:description>
                    <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
                </command:parameter>
                <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                    <maml:name>Circular</maml:name>
                    <maml:description>
                        <maml:para>Indicates that output file should be a circular log with first in, first out (FIFO) format. When you include this parameter, the MaxSize parameter is required.</maml:para>
                    </maml:description>
                </command:parameter>
                <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named" aliases="">
                    <maml:name>FileFormat</maml:name>
                    <maml:description>
                        <maml:para>Specifies the output format of the output log file. Valid values are CSV, TSV, and BLG. The default value is BLG.</maml:para>
                    </maml:description>
                    <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
                </command:parameter>
                <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                    <maml:name>Force</maml:name>
                    <maml:description>
                        <maml:para>Overwrites and replaces an existing file if one exists in the location specified by the Path parameter.</maml:para>
                    </maml:description>
                </command:parameter>
                <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                    <maml:name>MaxSize</maml:name>
                    <maml:description>
                        <maml:para>Specifies the maximum size of the output file.</maml:para>
                        <maml:para>If the Circular parameter is specified, then when the log file reaches the specified maximum size, the oldest entries are deleted as newer ones are added. If the Circular parameter is not specified, then when the log file reaches the specified maximum size, no new data is added and the cmdlet generates a non-terminating error.</maml:para>
                    </maml:description>
                    <command:parameterValue required="true" variableLength="false">UInt32</command:parameterValue>
                </command:parameter>
                <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named" aliases="">
                    <maml:name>InputObject</maml:name>
                    <maml:description>
                        <maml:para>Specifies the counter data to export. Enter a variable that contains the data or a command that gets the data, such as a Get-Counter or Import-Counter command.</maml:para>
                    </maml:description>
                    <command:parameterValue required="true" variableLength="true">PerformanceCounterSampleSet[]</command:parameterValue>
                </command:parameter>
            </command:syntaxItem>
        </command:syntax>
        <command:parameters>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                <maml:name>Circular</maml:name>
                <maml:description>
                    <maml:para>Indicates that output file should be a circular log with first in, first out (FIFO) format. When you include this parameter, the MaxSize parameter is required.</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="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named" aliases="">
                <maml:name>FileFormat</maml:name>
                <maml:description>
                    <maml:para>Specifies the output format of the output log file. Valid values are CSV, TSV, and BLG. The default value is BLG.</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>BLG</dev:defaultValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                <maml:name>Force</maml:name>
                <maml:description>
                    <maml:para>Overwrites and replaces an existing file if one exists in the location specified by the Path parameter.</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="true" variableLength="true" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named" aliases="">
                <maml:name>InputObject</maml:name>
                <maml:description>
                    <maml:para>Specifies the counter data to export. Enter a variable that contains the data or a command that gets the data, such as a Get-Counter or Import-Counter command.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="true">PerformanceCounterSampleSet[]</command:parameterValue>
                <dev:type>
                    <maml:name>PerformanceCounterSampleSet[]</maml:name>
                    <maml:uri />
                </dev:type>
                <dev:defaultValue></dev:defaultValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
                <maml:name>MaxSize</maml:name>
                <maml:description>
                    <maml:para>Specifies the maximum size of the output file.</maml:para>
                    <maml:para>If the Circular parameter is specified, then when the log file reaches the specified maximum size, the oldest entries are deleted as newer ones are added. If the Circular parameter is not specified, then when the log file reaches the specified maximum size, no new data is added and the cmdlet generates a non-terminating error.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">UInt32</command:parameterValue>
                <dev:type>
                    <maml:name>UInt32</maml:name>
                    <maml:uri />
                </dev:type>
                <dev:defaultValue></dev:defaultValue>
                </command:parameter>
            <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="1" aliases="">
                <maml:name>Path</maml:name>
                <maml:description>
                    <maml:para>Specifies the path and file name of the output file. Enter a relative or absolute path on the local computer, or a Uniform Naming Convention (UNC) path to a remote computer, such as \\Computer\Share\file.blg. This parameter is required.</maml:para>
                    <maml:para>Note: The file format is determined by the value of the FileFormat parameter, not by the file name extension in the path.</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></dev:defaultValue>
            </command:parameter>
        </command:parameters>
        <command:inputTypes>
            <command:inputType>
                <dev:type>
                    <maml:name> Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet</maml:name>
                    <maml:uri></maml:uri>
                    <maml:description><maml:para /></maml:description>
                </dev:type>
                <maml:description>
                    <maml:para>You can pipe performance counter data from Get-Counter or Import-Counter to Export-Counter.</maml:para>
                </maml:description>
            </command:inputType>
        </command:inputTypes>
        <command:returnValues>
            <command:returnValue>
                <dev:type>
                    <maml:name>None</maml:name>
                    <maml:uri></maml:uri>
                    <maml:description>
                        <maml:para />
                    </maml:description>
                </dev:type>
                <maml:description>
                    <maml:para></maml:para>
                </maml:description>
            </command:returnValue>
        </command:returnValues>
        <command:terminatingErrors />
        <command:nonTerminatingErrors />
        <maml:alertSet>
            <maml:title />
            <maml:alert>
                <maml:para>The log file generator expects that all input objects have the same counter path and that the objects are arranged in ascending time order.</maml:para>
                <maml:para>The counter type and path of the first input object determines the properties recorded in the log file. If other input objects do not have a value for a recorded property, the property field is empty. If the objects have property values that were not recorded, the extra property values are ignored.</maml:para>
                <maml:para>Performance Monitor might not be able to read all logs that Export-Counter generates. For example, Performance Monitor requires that all objects have the same path and that all objects are separated by the same time interval.</maml:para>
                <maml:para>The Import-Counter cmdlet does not have a ComputerName parameter. However, if the computer is configured for Windows PowerShell remoting, you can use the Invoke-Command cmdlet to run an Import-Counter command on a remote computer.</maml:para>
            </maml:alert>
            <maml:alert>
                <maml:para></maml:para>
            </maml:alert>
        </maml:alertSet>
        <command:examples>
            <command:example>
                <maml:title>
  
-------------------------- EXAMPLE 1 --------------------------
  
                </maml:title>
                <maml:introduction>
                    <maml:para></maml:para>
                </maml:introduction>
                <dev:code>PS C:\&gt;Get-Counter "\Processor(*)\% Processor Time" | Export-Counter -Path $home\Counters.blg</dev:code>
                <dev:remarks>
                    <maml:para>This command exports counter data to a .blg file.</maml:para>
                    <maml:para>The command uses the Get-Counter cmdlet to collect processor time data. It uses a pipeline operator (|) to send the data to the Export-Counter cmdlet. The Export-Counter command uses the Path variable to specify the output file.</maml:para>
                    <maml:para>Because the data set might be very large, this command sends the data to Export-Counter through the pipeline. If the data were saved in a variable, the command might use a disproportionate amount of memory.</maml:para>
                </dev:remarks>
                <command:commandLines>
                    <command:commandLine>
                        <command:commandText />
                    </command:commandLine>
                </command:commandLines>
            </command:example>
            <command:example>
                <maml:title>
  
-------------------------- EXAMPLE 2 --------------------------
  
                </maml:title>
                <maml:introduction>
                    <maml:para></maml:para>
                </maml:introduction>
                <dev:code>The first command uses the built-in Windows PowerShell conversion feature to store the value of 1 gigabyte (GB) in bytes in the $1GBInBytes variable. When you type a value followed by K (kilobyte), MB (megabyte), or GB, Windows PowerShell returns the value in bytes.
PS C:\&gt;$1GBInBytes = 1GB
 
The second command uses the Import-Counter cmdlet to import performance counter data from the Threads.csv file. The example presumes that this file was previously exported by using the Export-Counter cmdlet. A pipeline operator (|) sends the imported data to the Export-Counter cmdlet. The command uses the Path parameter to specify the location of the output file. It uses the Circular and MaxSize parameters to direct Export-Counter to create a circular log that wraps at 1 GB.
PS C:\&gt;Import-Counter Threads.csv | Export-Counter -Path ThreadTest.blg -Circular -MaxSize $1GBinBytes
</dev:code>
                <dev:remarks>
                    <maml:para>These commands convert a CSV file to a counter data BLG format.</maml:para>
                </dev:remarks>
                <command:commandLines>
                    <command:commandLine>
                        <command:commandText />
                    </command:commandLine>
                </command:commandLines>
            </command:example>
            <command:example>
                <maml:title>
  
-------------------------- EXAMPLE 3 --------------------------
  
                </maml:title>
                <maml:introduction>
                    <maml:para></maml:para>
                </maml:introduction>
                <dev:code>The first command uses the Get-Counter cmdlet to collect working set counter data from Server01, a remote computer. The command saves the data in the $c variable.
PS C:\&gt;$c = Get-Counter -ComputerName Server01 -Counter "\Process(*)\Working Set - Private" -MaxSamples 20
 
The second command uses a pipeline operator (|) to send the data in $c to the Export-Counter cmdlet, which saves it in the Workingset.blg file in the Perf share of the Server01 computer.
PS C:\&gt;$c | Export-Counter -Path \\Server01\Perf\WorkingSet.blg
</dev:code>
                <dev:remarks>
                    <maml:para>This example shows how to get performance counter data from a remote computer and save the data in a file on the remote computer.</maml:para>
                </dev:remarks>
                <command:commandLines>
                    <command:commandLine>
                        <command:commandText />
                    </command:commandLine>
                </command:commandLines>
            </command:example>
            <command:example>
                <maml:title>
  
-------------------------- EXAMPLE 4 --------------------------
  
                </maml:title>
                <maml:introduction>
                    <maml:para></maml:para>
                </maml:introduction>
                <dev:code>The first command uses the Import-Counter cmdlet to import performance counter data from the DiskSpace.blg log. It saves the data in the $All variable. This file contains samples of the "LogicalDisk\% Free Space" counter on more than 200 remote computers in the enterprise.
PS C:\&gt;$All = Import-Counter DiskSpace.blg
 
The second command uses the CounterSamples property of the sample set object in $All and the Where-Object cmdlet (alias = "where") to select objects with CookedValues of less than 15 (percent). The command saves the results in the $LowSpace variable.
PS C:\&gt;$LowSpace = $All.CounterSamples | where {$_.CookedValues -lt 15}
 
The third command uses a pipeline operator (|) to send the data in the $LowSpace variable to the Export-Counter cmdlet. The command uses the Path parameter to indicate that the selected data should be logged in the LowDiskSpace.blg file.
PS C:\&gt;$LowSpace | Export-Counter -Path LowDiskSpace.blg
</dev:code>
                <dev:remarks>
                    <maml:para>This example shows how to use the Import-Counter and Export-Counter cmdlets to re-log existing data.</maml:para>
                </dev:remarks>
                <command:commandLines>
                    <command:commandLine>
                        <command:commandText />
                    </command:commandLine>
                </command:commandLines>
            </command:example>
        </command:examples>
        <maml:relatedLinks>
            <maml:navigationLink>
                <maml:linkText>Online Version:</maml:linkText>
                <maml:uri>http://go.microsoft.com/fwlink/p/?linkid=289624</maml:uri>
            </maml:navigationLink>
            <maml:navigationLink>
                <maml:linkText>Get-Counter</maml:linkText>
                <maml:uri />
            </maml:navigationLink>
            <maml:navigationLink>
                <maml:linkText>Import-Counter</maml:linkText>
                <maml:uri />
            </maml:navigationLink>
        </maml:relatedLinks>
    </command:command>
</helpItems>