- Module
PSWriteOffice- Aliases
WordHeader- Inputs
None
Adds content to a section header.
Description
Ensures the requested header part (default/first/even) exists and executes the DSL scriptblock within it.
Guides & Samples
Authored walkthroughs and practical samples linked to this command.
Replace archived PSWriteWord scripts with maintained PSWriteOffice Word commands for DOCX creation, editing, review, merge, and conversion.
Collect Windows errors with PSEventViewer, explain the snapshot in a Word and PDF brief, and keep the full messages in an editable Excel register.
Read supplier offers with PSParseHTML, compare price and delivery, and create an editable Word review, PDF and numeric Excel workbook with PSWriteOffice.
Turn dated milestones into an editable register and a Word/PDF review with completed counts, overdue work and named recovery actions.
Reconcile annual budget, actual spending and forecast in an editable workbook, then produce a Word/PDF review with owner decisions for overspend exceptions.
Review patch compliance and site exceptions with a PowerShell report, including a summary chart, an editable Word document and a PDF.
Examples
Create a default header.
Add-OfficeWordSection { Add-OfficeWordHeader { Add-OfficeWordParagraph -Text 'Confidential' -Style Heading3 } }
Creates a section header that prints “Confidential”.
Parameters
- -Content ScriptBlock optionalposition: 0
- DSL scriptblock to execute inside the header.
- -PassThru SwitchParameter optional
- Emit the object created or changed by the command.
- -Type WordHeaderFooterType optional
- The header type to modify.
- Possible values:
Default, First, Even
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.