Evotec

Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 144
Forks 12
Open issues 16
PowerShell Gallery downloads 150,904
Release v0.2.0
Language: C# Updated: 2026-04-06

API Reference

Cmdlet

Get-OfficeCsvData

Namespace PSWriteOffice
Inputs
OfficeIMO.CSV.CsvDocument
Outputs
System.Object

Reads CSV rows as PSCustomObjects or dictionaries.

Remarks

Uses the CSV header to map fields to property names.

Examples

Authored help example

Read rows as PSCustomObjects.

PS>


Get-OfficeCsvData -Path .\data.csv | Format-Table
        

Returns each row as a PSCustomObject.

Read rows as dictionaries.

PS>


Get-OfficeCsvData -Path .\data.csv -AsHashtable | ForEach-Object { $_['Name'] }
        

Uses hashtables for dynamic schemas or key-based access.

Read semicolon-delimited data without headers.

PS>


Get-OfficeCsvData -Path .\data.csv -Delimiter ';' -HasHeaderRow:$false
        

Reads CSV files that lack a header row and use a custom 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.

Syntax

Get-OfficeCsvData [-AllowEmptyLines] [-AsHashtable] [-Culture <CultureInfo>] [-Delimiter <Char>] [-Document <CsvDocument>] [-Encoding <Encoding>] [-HasHeaderRow <Boolean>] [-InputPath <String>] [-Mode <InMemory|Stream>] [-TrimWhitespace <Boolean>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AllowEmptyLines SwitchParameter optionalposition: namedpipeline: False
Allow empty lines in the input.
AsHashtable SwitchParameter optionalposition: namedpipeline: False
Emit dictionaries instead of PSCustomObjects.
Culture CultureInfo optionalposition: namedpipeline: False
Culture used for type conversions.
Delimiter Char optionalposition: namedpipeline: False
Field delimiter character.
Document CsvDocument optionalposition: namedpipeline: True (ByValue)
CSV document to read when already loaded.
Encoding Encoding optionalposition: namedpipeline: False
Encoding used when reading the file.
HasHeaderRow Boolean optionalposition: namedpipeline: False
Indicates whether the first record is a header row.
InputPath String optionalposition: 0pipeline: Falsealiases: FilePath, Path
Path to a CSV file.
Mode CsvLoadMode optionalposition: namedpipeline: Falsevalues: 2
Load mode controlling materialization.
Possible values: InMemory, Stream
TrimWhitespace Boolean optionalposition: namedpipeline: False
Trim whitespace around unquoted fields.

Outputs

System.Object