CmdID / PowerShell / Cmdlets / ConvertTo
ConvertTo-Csv
Converts .NET objects into a series of character-separated value (CSV) strings. PowerShell reference
From the PowerShell reference 4 parameters
What it does
Converts .NET objects into a series of character-separated value (CSV) strings. The ConvertTo-Csv cmdlet returns a series of character-separated value (CSV) strings that represent the objects that you submit. You can then use the ConvertFrom-Csv cmdlet to recreate objects from the CSV strings. The objects converted from CSV are string values of the original objects that contain property values and no methods. You can use the Export-Csv cmdlet to convert objects to CSV strings. Export-Csv is similar to ConvertTo-Csv, except that it saves the CSV strings to a file. The ConvertTo-Csv cmdlet has parameters to specify a delimiter other than a comma or use the current culture as the delimiter.
ConvertTo-Csv [-InputObject] <psobject> [[-Delimiter] <char>] [-NoTypeInformation] [<CommonParameters>]ConvertTo-Csv [-InputObject] <psobject> [-UseCulture] [-NoTypeInformation] [<CommonParameters>]
Convert an object to CSV
Get-Process -Name 'PowerShell' | ConvertTo-Csv -NoTypeInformationIdentifyConvert a DateTime object to CSV
$Date = Get-Date
ConvertTo-Csv -InputObject $Date -Delimiter ';' -NoTypeInformationIdentifyConvert the PowerShell event log to CSV
(Get-Culture).TextInfo.ListSeparator
Get-WinEvent -LogName 'Windows PowerShell' | ConvertTo-Csv -UseCulture -NoTypeInformationIdentifyTrips 2 Sigma rules: mediumEventLog Query Requests By Builtin Utilities by Ali Alwashali, Nasreddine Bencherchali (Nextron Systems); mediumPotentially Suspicious EventLog Recon Activity Using Log Query Utilities by Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
Its page in the reference: ConvertTo-Csv.
Parameters
-DelimiterSpecifies the delimiter to separate the property values in CSV strings. The default is a comma (,).
Enter a character, such as a colon (:). To specify a semicolon (;), enclose it in single quotation marks. To specify escaped special characters such as tab ( t ), enclose it in double quotation marks.-InputObjectSpecifies the objects that are converted to CSV strings. Enter a variable that contains the objects or type a command or expression that gets the objects. You can also pipe objects to ConvertTo-Csv.-NoTypeInformationRemoves the #TYPE information header from the output. This parameter became the default in PowerShell 6.0 and is included for backwards compatibility.-UseCultureUses the list separator for the current culture as the item delimiter. To find the list separator for a culture, use the following command: (Get-Culture).TextInfo.ListSeparator.