Cmdlet
Set-OfficeExcelHeaderFooter
Sets worksheet header and footer text and optional images.
Syntax
Description
Uses OfficeIMO.Excel header/footer APIs and supports DSL or document usage.
Examples
Set a centered header with a page footer.
ExcelSheet 'Data' { Set-OfficeExcelHeaderFooter -HeaderCenter 'Demo' -FooterRight 'Page &P of &N' }Applies header and footer text to the worksheet.
Parameters
- -AlignWithMargins Boolean
- Align header/footer with margins (default: true).
- -DifferentFirstPage SwitchParameter
- Use a different header/footer on the first page.
- -DifferentOddEven SwitchParameter
- Use different headers/footers on odd/even pages.
- Center footer text.
- Footer image file path.
- Footer image position.
- Possible values:
Left,Center,Right - Footer image URL.
- Left footer text.
- Right footer text.
- -HeaderCenter String
- Center header text.
- -HeaderImagePath String
- Header image file path.
- -HeaderImagePosition ExcelHeaderFooterPosition
- Header image position.
- Possible values:
Left,Center,Right - -HeaderImageUrl String
- Header image URL.
- -HeaderLeft String
- Left header text.
- -HeaderRight String
- Right header text.
- -ImageHeightPoints Double
- Image height in points.
- -ImageWidthPoints Double
- Image width in points.
- -PassThru SwitchParameter
- Emit the worksheet after updating.
- -ScaleWithDocument Boolean
- Scale header/footer with document (default: true).
- -Document ExcelDocument
- Workbook to operate on outside the DSL context.
- -Sheet String
- Worksheet name when using Document.
- -SheetIndex Int32
- Worksheet index (0-based) when using Document.
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.