Export-OfficeExcel
Exports PowerShell objects to an Excel workbook using an operator-friendly surface.
Syntax
Export-OfficeExcel
[-ApplicationName <String>]
[-Author <String>]
[-AutoFit]
[-AutoFitFormattedColumn]
[-BoldTopRow]
[-Category <String>]
[-ClearCachedFormulaResults]
[-CollectionSeparator <String>]
[-ColumnFormat <Hashtable>]
[-Company <String>]
[-CurrencyColumn <String[]>]
[-DateColumn <String[]>]
[-DateSystem <1900| 1904| NineteenHundred| NineteenFour>]
[-DateTimeColumn <String[]>]
[-Description <String>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
[-DisableFastPackageWriter]
[-DocumentTitle <String>]
[-EvaluateFormulas]
[-ExcludeProperty <String[]>]
[-ForceFullCalculationOnOpen]
[-FormatCultureName <String>]
[-FormatDecimals <Int32>]
[-FreezeFirstColumn]
[-FreezeTopRow]
[-IgnoreMissingColumnFormat]
[-IncludeHeaderInColumnFormat]
[-IncludeUnexportableProperties]
[-InputObject <Object>]
[-IntegerColumn <String[]>]
[-Keywords <String>]
[-LastModifiedBy <String>]
[-Manager <String>]
[-MarkFormulasDirty]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-NoAutoFilter]
[-NoClobber]
[-NoHeader]
[-NoRowStripes]
[-NoTable]
[-NumberColumn <String[]>]
[-Open]
[-PassThru]
[-Path] <String>
[-PercentColumn <String[]>]
[-PropertyConversionErrorAction <ActionPreference>]
[-SafePreflight]
[-SafeRepairDefinedNames]
[-ShowColumnStripes]
[-ShowFirstColumn]
[-ShowLastColumn]
[-StartColumn <Int32>]
[-StartRow <Int32>]
[-Subject <String>]
[-TableName <String>]
[-TableStyle <ExcelTableStyle>]
[-TextColumn <String[]>]
[-Title <String>]
[-ValidateOpenXml]
[-WorksheetName <String>]
[<CommonParameters>]#CreateExport-OfficeExcel
-Append
[-AppendToTable]
[-ApplicationName <String>]
[-Author <String>]
[-AutoFit]
[-AutoFitFormattedColumn]
[-BoldTopRow]
[-Category <String>]
[-ClearCachedFormulaResults]
[-CollectionSeparator <String>]
[-ColumnFormat <Hashtable>]
[-Company <String>]
[-CurrencyColumn <String[]>]
[-DateColumn <String[]>]
[-DateSystem <1900| 1904| NineteenHundred| NineteenFour>]
[-DateTimeColumn <String[]>]
[-Description <String>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
[-DisableFastPackageWriter]
[-DocumentTitle <String>]
[-EvaluateFormulas]
[-ExcludeProperty <String[]>]
[-ForceFullCalculationOnOpen]
[-FormatCultureName <String>]
[-FormatDecimals <Int32>]
[-FreezeFirstColumn]
[-FreezeTopRow]
[-IgnoreMissingColumnFormat]
[-IncludeHeaderInColumnFormat]
[-IncludeUnexportableProperties]
[-InputObject <Object>]
[-IntegerColumn <String[]>]
[-Keywords <String>]
[-LastModifiedBy <String>]
[-Manager <String>]
[-MarkFormulasDirty]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-NoAutoFilter]
[-NoClobber]
[-NoHeader]
[-NoRowStripes]
[-NoTable]
[-NumberColumn <String[]>]
[-Open]
[-PassThru]
[-Path] <String>
[-PercentColumn <String[]>]
[-PropertyConversionErrorAction <ActionPreference>]
[-SafePreflight]
[-SafeRepairDefinedNames]
[-ShowColumnStripes]
[-ShowFirstColumn]
[-ShowLastColumn]
[-StartColumn <Int32>]
[-StartRow <Int32>]
[-Subject <String>]
[-TableName <String>]
[-TableStyle <ExcelTableStyle>]
[-TextColumn <String[]>]
[-Title <String>]
[-ValidateOpenXml]
[-WorksheetName <String>]
[<CommonParameters>]#AppendExport-OfficeExcel
[-ApplicationName <String>]
[-Author <String>]
[-AutoFit]
[-AutoFitFormattedColumn]
[-BoldTopRow]
[-Category <String>]
[-ClearCachedFormulaResults]
-ClearSheet
[-CollectionSeparator <String>]
[-ColumnFormat <Hashtable>]
[-Company <String>]
[-CurrencyColumn <String[]>]
[-DateColumn <String[]>]
[-DateSystem <1900| 1904| NineteenHundred| NineteenFour>]
[-DateTimeColumn <String[]>]
[-Description <String>]
[-DictionaryEntrySeparator <String>]
[-DictionaryKeyValueSeparator <String>]
[-DisableFastPackageWriter]
[-DocumentTitle <String>]
[-EvaluateFormulas]
[-ExcludeProperty <String[]>]
[-ForceFullCalculationOnOpen]
[-FormatCultureName <String>]
[-FormatDecimals <Int32>]
[-FreezeFirstColumn]
[-FreezeTopRow]
[-IgnoreMissingColumnFormat]
[-IncludeHeaderInColumnFormat]
[-IncludeUnexportableProperties]
[-InputObject <Object>]
[-IntegerColumn <String[]>]
[-Keywords <String>]
[-LastModifiedBy <String>]
[-Manager <String>]
[-MarkFormulasDirty]
[-MaxCollectionItems <Int32>]
[-MaxNestingDepth <Int32>]
[-NoAutoFilter]
[-NoClobber]
[-NoHeader]
[-NoRowStripes]
[-NoTable]
[-NumberColumn <String[]>]
[-Open]
[-PassThru]
[-Path] <String>
[-PercentColumn <String[]>]
[-PropertyConversionErrorAction <ActionPreference>]
[-SafePreflight]
[-SafeRepairDefinedNames]
[-ShowColumnStripes]
[-ShowFirstColumn]
[-ShowLastColumn]
[-StartColumn <Int32>]
[-StartRow <Int32>]
[-Subject <String>]
[-TableName <String>]
[-TableStyle <ExcelTableStyle>]
[-TextColumn <String[]>]
[-Title <String>]
[-ValidateOpenXml]
[-WorksheetName <String>]
[<CommonParameters>]#ClearSheetDescription
Provides a fast PowerShell export path while keeping OfficeIMO as the workbook engine.
Examples
Export objects to a table.
$rows | Export-OfficeExcel -Path .\Report.xlsx -WorksheetName Data -TableName Data -AutoFit -FreezeTopRowCreates a workbook, writes the objects as a table, auto-fits columns, and freezes the header row.
Export objects with report-friendly column formats.
$rows | Export-OfficeExcel -Path .\Report.xlsx -WorksheetName Data -TableName Sales -TextColumn Id -CurrencyColumn Revenue -ColumnFormat @{ Rate = @{ Style = 'Percent'; Decimals = 1 }; Created = 'Date' } -FormatCultureName en-US -AutoFitFormattedColumnFormats ID values as text, Revenue as currency, Rate as a one-decimal percentage, and Created as a short date while keeping formatting logic in OfficeIMO.
Parameters
- -ApplicationName String
- Workbook application-name metadata.
- Workbook author metadata.
- -AutoFit SwitchParameter
- Auto-fit exported columns.
- -AutoFitFormattedColumn SwitchParameter
- Auto-fit only columns that receive export-time column formats.
- -BoldTopRow SwitchParameter
- Bold the exported header row.
- -Category String
- Workbook category metadata.
- -ClearCachedFormulaResults SwitchParameter
- Remove cached formula results before saving.
- -CollectionSeparator String
- Text used between items when a cell contains a collection.
- -ColumnFormat Hashtable
- Header-to-format map. Values may be preset names such as Text, Currency, Percent, Date, or custom Excel number formats.
- -Company String
- Workbook company metadata.
- -CurrencyColumn String[]
- Headers that should be formatted as currency.
- -DateColumn String[]
- Headers that should be formatted as dates.
- -DateSystem String
- Workbook date system for Excel date serials.
- Possible values:
1900,1904,NineteenHundred,NineteenFour - -DateTimeColumn String[]
- Headers that should be formatted as date/time values.
- -Description String
- Workbook description metadata.
- -DictionaryEntrySeparator String
- Text used between entries when a cell contains a dictionary.
- -DictionaryKeyValueSeparator String
- Text used between a dictionary key and value.
- -DisableFastPackageWriter SwitchParameter
- Disable OfficeIMO fast package writers for this save.
- -DocumentTitle String
- Workbook document title metadata.
- -EvaluateFormulas SwitchParameter
- Evaluate supported formulas and write cached values before saving.
- -ExcludeProperty String[]
- Exclude specific properties from exported objects.
- -ForceFullCalculationOnOpen SwitchParameter
- Request a full workbook recalculation when opened in Excel-compatible applications.
- -FormatCultureName String
- Culture used by friendly currency column presets, such as en-US or pl-PL.
- -FormatDecimals Int32
- Decimal places used by friendly number, percent, and currency column presets.
- -FreezeFirstColumn SwitchParameter
- Freeze the first exported column.
- -FreezeTopRow SwitchParameter
- Freeze the exported header row.
- -IgnoreMissingColumnFormat SwitchParameter
- Continue when a requested export-time column format header is missing.
- -IncludeHeaderInColumnFormat SwitchParameter
- Include header cells when applying export-time column formats.
- -IncludeUnexportableProperties SwitchParameter
- Include properties that cannot be read by exporting a descriptive placeholder value.
- -InputObject Object
- Objects to write. Accepts pipeline input.
- -IntegerColumn String[]
- Headers that should be formatted as whole numbers.
- -Keywords String
- Workbook keyword metadata.
- -LastModifiedBy String
- Workbook last-modified-by metadata.
- -Manager String
- Workbook manager metadata.
- -MarkFormulasDirty SwitchParameter
- Mark formula cells dirty before saving.
- -MaxCollectionItems Int32
- Maximum number of items allowed in one nested collection or dictionary cell. Defaults to 1,048,575; increase explicitly for trusted larger values.
- -MaxNestingDepth Int32
- Maximum nesting depth allowed while normalizing one cell value. Defaults to 64; increase explicitly for trusted deeper values.
- -NoAutoFilter SwitchParameter
- Disable AutoFilter dropdowns on the created table.
- -NoClobber SwitchParameter
- Do not overwrite an existing workbook unless appending or clearing a sheet.
- -NoHeader SwitchParameter
- Do not emit a header row.
- -NoRowStripes SwitchParameter
- Disable alternating row stripes for newly created tables.
- -NoTable SwitchParameter
- Do not create an Excel table around the exported data.
- -NumberColumn String[]
- Headers that should be formatted as decimal numbers.
- -Open SwitchParameter
- Open the workbook after saving.
- -PassThru SwitchParameter
- Emit the saved FileInfo.
- -Path String
- Destination workbook path.
- -PercentColumn String[]
- Headers that should be formatted as percentages.
- -PropertyConversionErrorAction ActionPreference
- Controls how unreadable PowerShell properties are handled while projecting export rows.
- Possible values:
SilentlyContinue,Stop,Continue,Inquire,Ignore,Suspend,Break - -SafePreflight SwitchParameter
- Run OfficeIMO worksheet preflight cleanup before saving.
- -SafeRepairDefinedNames SwitchParameter
- Repair common defined-name issues before saving.
- -ShowColumnStripes SwitchParameter
- Enable alternating column stripes for newly created tables.
- -ShowFirstColumn SwitchParameter
- Emphasize the first table column when the selected style supports it.
- -ShowLastColumn SwitchParameter
- Emphasize the last table column when the selected style supports it.
- -StartColumn Int32
- Starting column for new exports.
- -StartRow Int32
- Starting row for new exports. When appending and left at 1, rows are written after the used range.
- -Subject String
- Workbook subject metadata.
- -TableName String
- Optional Excel table name.
- -TableStyle ExcelTableStyle
- Built-in Excel table style name.
- Possible values:
TableStyleLight1,TableStyleLight2,TableStyleLight3,TableStyleLight4,TableStyleLight5,TableStyleLight6,TableStyleLight7,TableStyleLight8,TableStyleLight9,TableStyleLight10,TableStyleLight11,TableStyleLight12,TableStyleLight13,TableStyleLight14,TableStyleLight15,TableStyleLight16,TableStyleLight17,TableStyleLight18,TableStyleLight19,TableStyleLight20,TableStyleLight21,TableStyleMedium1,TableStyleMedium2,TableStyleMedium3,TableStyleMedium4,TableStyleMedium5,TableStyleMedium6,TableStyleMedium7,TableStyleMedium8,TableStyleMedium9,TableStyleMedium10,TableStyleMedium11,TableStyleMedium12,TableStyleMedium13,TableStyleMedium14,TableStyleMedium15,TableStyleMedium16,TableStyleMedium17,TableStyleMedium18,TableStyleMedium19,TableStyleMedium20,TableStyleMedium21,TableStyleMedium22,TableStyleMedium23,TableStyleMedium24,TableStyleMedium25,TableStyleMedium26,TableStyleMedium27,TableStyleMedium28,TableStyleDark1,TableStyleDark2,TableStyleDark3,TableStyleDark4,TableStyleDark5,TableStyleDark6,TableStyleDark7,TableStyleDark8,TableStyleDark9,TableStyleDark10,TableStyleDark11 - -TextColumn String[]
- Headers that should be formatted as text, useful for IDs, zip codes, and leading-zero values.
- -Title String
- Write a title above the exported table.
- -ValidateOpenXml SwitchParameter
- Validate the saved package with OpenXmlValidator and throw on errors.
- -WorksheetName String
- Worksheet name to create or update.
- -Append SwitchParameter
- Append rows to an existing worksheet when the workbook exists.
- -AppendToTable SwitchParameter
- Require append operations to extend an existing Excel table instead of writing after the used range.
- -ClearSheet SwitchParameter
- Replace the target worksheet inside an existing workbook.
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.