# ConvertTo-OfficeCsv

Converts objects or a CSV document into CSV text. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.CSV.CsvDocument` `System.Object`

**Outputs**

`System.String`

**Source**

[ConvertToOfficeCsvCommand.cs:37](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Csv/ConvertToOfficeCsvCommand.cs#L37) 

Converts objects or a CSV document into CSV text.

## Syntax

```
ConvertTo-OfficeCsv
[-Culture <CultureInfo>]
[-DateTimeFormat <String>]
[-Delimiter <Char>]
[-DelimiterText <String>]
[-FormulaInjectionPolicy <Preserve|Escape>]
[-InputObject <Object>]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-NewLine <String>]
[-NoHeader]
[-NullValue <String>]
[-QuoteFields <String[]>]
[-UseQuotes <AsNeeded|Always|Never>]
[-UseUtc]
[<CommonParameters>]
```

[#](#method-convertto-officecsv-cultureinfo-string-char-string-csvformulainjectionpolicy-object-int32-int32-string-switchparameter-string-string-csvquotemode-switchparameter)

Parameter set: `InputObjectDelimiter`

```
ConvertTo-OfficeCsv
[-Culture <CultureInfo>]
[-DateTimeFormat <String>]
[-Delimiter <Char>]
[-DelimiterText <String>]
-Document <CsvDocument>
[-FormulaInjectionPolicy <Preserve|Escape>]
[-NewLine <String>]
[-NoHeader]
[-NullValue <String>]
[-QuoteFields <String[]>]
[-UseQuotes <AsNeeded|Always|Never>]
[-UseUtc]
[<CommonParameters>]
```

[#](#method-convertto-officecsv-cultureinfo-string-char-string-csvdocument-csvformulainjectionpolicy-string-switchparameter-string-string-csvquotemode-switchparameter)

Parameter set: `DocumentDelimiter`

```
ConvertTo-OfficeCsv
[-Culture <CultureInfo>]
[-DateTimeFormat <String>]
-Document <CsvDocument>
[-FormulaInjectionPolicy <Preserve|Escape>]
[-NewLine <String>]
[-NoHeader]
[-NullValue <String>]
[-QuoteFields <String[]>]
-UseCulture
[-UseQuotes <AsNeeded|Always|Never>]
[-UseUtc]
[<CommonParameters>]
```

[#](#method-convertto-officecsv-cultureinfo-string-csvdocument-csvformulainjectionpolicy-string-switchparameter-string-string-switchparameter-csvquotemode-switchparameter)

Parameter set: `DocumentCulture`

```
ConvertTo-OfficeCsv
[-Culture <CultureInfo>]
[-DateTimeFormat <String>]
[-FormulaInjectionPolicy <Preserve|Escape>]
[-InputObject <Object>]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-NewLine <String>]
[-NoHeader]
[-NullValue <String>]
[-QuoteFields <String[]>]
-UseCulture
[-UseQuotes <AsNeeded|Always|Never>]
[-UseUtc]
[<CommonParameters>]
```

[#](#method-convertto-officecsv-cultureinfo-string-csvformulainjectionpolicy-object-int32-int32-string-switchparameter-string-string-switchparameter-csvquotemode-switchparameter)

Parameter set: `InputObjectCulture`

## Description

Use Export-OfficeCsv when the destination is a file.

## Examples

### Convert objects to CSV text.

```powershell
$csv = $data | ConvertTo-OfficeCsv
```

Generates CSV text from the input objects.

### Export with a stable schema order.

```powershell
$rows = @(
  [ordered]@{ Id = 1; Name = 'Alpha'; Total = 10.5 },
  [ordered]@{ Id = 2; Name = 'Beta'; Total = 7.25 }
)
$csv = $rows | ConvertTo-OfficeCsv -Delimiter ';'
```

Uses ordered dictionaries to enforce column order and a custom delimiter.

### Write CSV without headers.

```powershell
$csv = $data | ConvertTo-OfficeCsv -NoHeader
```

Writes rows only when a downstream system expects headerless CSV.

## Parameters

**-Culture CultureInfo optional**

Culture used for value formatting.

**-DateTimeFormat String optional**

Date/time format used for DateTime and DateTimeOffset values.

**-Delimiter Char optionalsets: InputObjectDelimiter, DocumentDelimiter**

Field delimiter character.

**-DelimiterText String optionalsets: InputObjectDelimiter, DocumentDelimiter**

Field delimiter text for multi-character delimiters such as || or ::.

**-FormulaInjectionPolicy CsvFormulaInjectionPolicy optional**

Controls how formula-like values are written.

Possible values: `Preserve`, `Escape`

**-InputObject Object optionalpipeline: True (ByValue)sets: InputObjectDelimiter, InputObjectCulture**

Objects to convert into CSV rows.

**-MaxCollectionItems Int32 optionalsets: InputObjectDelimiter, InputObjectCulture**

Maximum number of items allowed in one nested collection or dictionary field. Defaults to 1,048,575; increase explicitly for trusted larger values.

**-MaxNestingDepth Int32 optionalsets: InputObjectDelimiter, InputObjectCulture**

Maximum nesting depth allowed while normalizing one field value. Defaults to 64; increase explicitly for trusted deeper values.

**-NewLine String optional**

Override the newline sequence.

**-NoHeader SwitchParameter optional**

Omit the header row from the output.

**-NullValue String optional**

Token written for null values.

**-QuoteFields String[] optional**

Field names that should always be quoted when UseQuotes is AsNeeded.

**-UseQuotes CsvQuoteMode optional**

Controls when CSV fields are quoted. Defaults to quoting only fields that need it.

Possible values: `AsNeeded`, `Always`, `Never`

**-UseUtc SwitchParameter optional**

Convert date/time values to UTC before formatting.

**-Document CsvDocument requiredpipeline: True (ByValue)sets: DocumentDelimiter, DocumentCulture**

CSV document to serialize.

**-UseCulture SwitchParameter requiredsets: DocumentCulture, InputObjectCulture**

Use the list separator from the selected or current culture as the delimiter.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:AADDADB9AC14828414DC2767E1FC8192112716B17950F5300F012EEA6D5BD1DA -->
