Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeExcelTemplateMarker

Module
PSWriteOffice
Inputs
OfficeIMO.Excel.ExcelDocument System.String[]

Lists template markers and, with -Value, which are bound.

Syntax

Get-OfficeExcelTemplateMarker
[-Document <ExcelDocument>]
[-MissingOnly]
[-Sheet <OfficeSheetSelector[]>]
[-Value <Hashtable>]
[<CommonParameters>]
#
Parameter set: Document
Get-OfficeExcelTemplateMarker
[-MissingOnly]
[-Path] <String[]>
[-Sheet <OfficeSheetSelector[]>]
[-Value <Hashtable>]
[<CommonParameters>]
#
Parameter set: Path
Get-OfficeExcelTemplateMarker
-LiteralPath <String[]>
[-MissingOnly]
[-Sheet <OfficeSheetSelector[]>]
[-Value <Hashtable>]
[<CommonParameters>]
#
Parameter set: LiteralPath

Examples

List the markers in a template

Get-OfficeExcelTemplateMarker -Path .\Templates\Service-Report.xltx

Shows every {{Marker}} in the template with its sheet and cell.

Find markers your data does not fill

$values = @{ Client = 'Northwind Traders'; Month = 'October 2026' }
Get-OfficeExcelTemplateMarker -Path .\Templates\Service-Report.xltx -Value $values -MissingOnly |
    Select-Object SheetName, CellReference, Name

Compares the template with the values a script is about to supply and lists only the markers that would stay unfilled.

Parameters

-Document ExcelDocument optionalpipeline: True (ByValue)sets: Document
Caller-owned workbook; omission uses the enclosing Excel content block.
-MissingOnly SwitchParameter optional
Only returns markers that are not supplied by -Value.
-Sheet OfficeSheetSelector[] optionalaliases: WorksheetName
Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
-Value Hashtable optional
Value or values consumed by the selected operation.
-Path String[] requiredposition: 0pipeline: True (ByValue)aliases: FilePathsets: Path
Workbook paths resolved with filesystem wildcard support.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Literal workbook paths, including FileInfo.FullName and provider PSPath.

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.