• Narrow screen resolution
  • Wide screen resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
© Diana Scherff, Amas-Veritas.com

Welcome to Amas Veritas [dot] com

Updates: Media (lyrics) has a new layout. I could never figure out how to lay it out, but it's easier to navigate now. I'm still working on a better duplicate Mamblog mod. I'm trying to make submittions easier but the poetry form died for some reason. Quizzes are also on their way from the old site. Joomla content isn't very code friendly so I'm having to rewrite old code. You can still click on News > AH v21 > Screen if you wish to use the quizzes.
 
Home arrow Tools arrow Windows PowerShell arrow Export-Csv [epcsv]
Export-Csv [epcsv] Print E-mail
Written by Diana, on 04-09-2007 00:12
Views 118    
Favoured None

PS C:\Users\Admin> help epcsv -full

NAME
    Export-Csv

SYNOPSIS
    Creates a comma-separated values (CSV) file that represents the input objects.

SYNTAX
    Export-Csv [-path] <string> -inputObject <psobject> [-force] [-encoding <string>] [-noTypeInformation] [-noClobber] [-whatIf] [-confirm] [<CommonParameters>]


DETAILED DESCRIPTION
    Creates a comma-separated values (CSV) file that represents the input objects.

    Unless the NoTypeInformation parameter is specified, the first line of the CSV file contains the string '#TYPE ' followed by the fully-qualified name of the type being represented. For example: #TYPE System.Diagnostics.Process.

    The next line of the CSV file represents column headers. It contains a comma-separated list of the names of all the properties of the first input object.

    Additional lines of the file contain comma-separated lists of the values of each of the properties named in the column header line for each input object.

    The first object establishes the column headers. The headers are not modified in response to subsequent input objects. If those objects do not include some of the properties in the column header line, no value is written for that property of that object. Instead, two commas are written to indicate a missing property and ensure proper alignment of property values with the property names in the column headers.

    Property values that contain commas, double quotes,  leading or trailing spaces, or line breaks, are put in double quotes before being written to the CSV file. Any double quotes contained in a property are redoubled to indicate that they are literal.

    You can use the Import-CSV cmdlet to use the information in the CSV file to recreate the input objects.


PARAMETERS
    -path <string>
        Specifies the path to the CSV to create.

        Required?                    true
        Position?                    1
        Default value                Null
        Accept pipeline input?       false
        Accept wildcard characters?  true

    -inputObject <psobject>
        Accepts objects that the cmdlet will represents as a CSV file. Enter a variable that contains the objects or type a command or expression that gets the objects.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?       true (ByValue)
        Accept wildcard characters?  false

    -force <SwitchParameter>
        Overwrites the file specified in path without prompting.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -encoding <string>
        Sets the type of encoding for the exported CSV file. Values can be: Unicode, UTF7, UTF8, ASCII.

        Required?                    false
        Position?                    named
        Default value                ASCII
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -noTypeInformation <SwitchParameter>
        Omits the #TYPE header from the CSV file. If this parameter is not specified, the first line of the CSV file contains the string "#TYPE " followed by the fully-qualified name of the type of the object. If this parameter is specified, no type information is included in the CSV file.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -noClobber <SwitchParameter>
        Will not overwrite (replace the contents) of an existing file. By default, if a file exists in the specified path, Export-Csv overwrites the file without warning.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -whatIf
        Describes what would happen if you executed the command without actually executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -confirm
        Prompts you for confirmation before executing the command.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".


INPUT TYPE
    Any object(s)


RETURN TYPE
    CSV list


NOTES


        The ToString method is called on each property of each input object to retrieve a string version of the value of the properties.

        For more information, type "Get-Help Export-Csv -detailed". For technical information, type "Get-Help Export-Csv -full".

        When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".


    ----------------- EXAMPLE 1 -----------------

    C:\PS>get-process wmiprvse | select-object basePriority,ID,SessionID,WorkingSet | export-csv -path data.csv


    This command selects a few properties of the wmiprvse process and exports them to a CSV format file named data.csv.






RELATED LINKS
    Import-Csv
    Export-Clixml
    ConvertTo-Html


Last update: 04-09-2007 00:12

Published in : Tools, Windows PowerShell

Users' Comments (0) RSS feed comment

No comment posted

Add your comment



mXcomment 1.0.4 © 2007-2009 - visualclinic.fr
License Creative Commons - Some rights reserved
 
< Prev   Next >




Double click any word on this page for a definition.
Using Firefox? Enable definitions by downloading the extension.
Sorry, this feature does not currently work in Opera or Safari.

No Users Online

Statistics

OS: FreeBSD
PHP: 5.2.1
MySQL: 4.1.21-log
Time: 21:27
Caching: Disabled
GZIP: Disabled
Members: 36
News: 2448
Web Links: 39
Visitors: 1443447

Syndicate

Login

Particls