Cmdlet
Set-OfficeExcelTheme
Sets or resets the workbook theme package part for an Excel workbook.
Syntax
Set-OfficeExcelTheme [-Default] [-Name <String>] [-PassThru] [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]#Parameter set:
ContextSet-OfficeExcelTheme [-Default] [-Name <String>] [-PassThru] [-Path] <String> [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]#Parameter set:
PathSet-OfficeExcelTheme [-Default] -Document <ExcelDocument> [-Name <String>] [-PassThru] [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]#Parameter set:
DocumentExamples
Reset and rename the workbook theme.
$theme = Set-OfficeExcelTheme -Path .\Report.xlsx -Default -Name 'Contoso Workbook Theme' -PassThru
Get-OfficeExcelSummary -Path .\Report.xlsx |
Select-Object Path, WorksheetCountWrites the built-in OfficeIMO workbook theme and updates its theme name.
Parameters
- -Default SwitchParameter
- Reset the workbook to the built-in OfficeIMO theme.
- -Name String
- Optional workbook theme name to apply after writing the theme.
- -PassThru SwitchParameter
- Emit workbook theme metadata after applying the update.
- -Xml String
- Theme XML to write to the workbook theme part.
- -XmlPath String
- Path to a DrawingML theme XML file.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- Workbook to update outside the DSL context.
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.