API Reference

Cmdlet

Add-OfficeExcelPackageMetadata

Aliases: ExcelConnectionMetadata, ExcelPackageMetadata
Namespace PSWriteOffice
Aliases
ExcelConnectionMetadata ExcelPackageMetadata
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Adds explicit workbook package metadata such as connection or query-table XML.

Remarks

Adds explicit workbook package metadata such as connection or query-table XML.

Examples

Authored help example

Add connection metadata and query-table metadata to an existing workbook.

PS>


Add-OfficeExcelPackageMetadata -Path .\Report.xlsx -Kind Connection -Xml $connectionsXml
            Add-OfficeExcelPackageMetadata -Path .\Report.xlsx -Kind QueryTable -WorksheetName Data -Xml $queryTableXml
        

Adds caller-supplied XML metadata parts. OfficeIMO preserves these parts but does not refresh external queries.

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.

Syntax

Add-OfficeExcelPackageMetadata -Kind <Connection|QueryTable> [-PassThru] [-WorksheetName <String>] -Xml <String> [<CommonParameters>]
#
Parameter set: Context

Parameters

Kind String requiredposition: namedpipeline: Falsevalues: 2
Metadata kind to add.
Possible values: Connection, QueryTable
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
WorksheetName String optionalposition: namedpipeline: Falsealiases: Sheet, SheetName, Worksheet
Worksheet for query-table metadata. Defaults to the current DSL sheet, or the first worksheet outside the DSL.
Xml String requiredposition: namedpipeline: False
XML payload to add as package metadata.

Outputs

System.Management.Automation.PSObject

Add-OfficeExcelPackageMetadata -InputPath <String> -Kind <Connection|QueryTable> [-PassThru] [-WorksheetName <String>] -Xml <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
Kind String requiredposition: namedpipeline: Falsevalues: 2
Metadata kind to add.
Possible values: Connection, QueryTable
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
WorksheetName String optionalposition: namedpipeline: Falsealiases: Sheet, SheetName, Worksheet
Worksheet for query-table metadata. Defaults to the current DSL sheet, or the first worksheet outside the DSL.
Xml String requiredposition: namedpipeline: False
XML payload to add as package metadata.

Outputs

System.Management.Automation.PSObject

Add-OfficeExcelPackageMetadata -Document <ExcelDocument> -Kind <Connection|QueryTable> [-PassThru] [-WorksheetName <String>] -Xml <String> [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
Kind String requiredposition: namedpipeline: Falsevalues: 2
Metadata kind to add.
Possible values: Connection, QueryTable
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
WorksheetName String optionalposition: namedpipeline: Falsealiases: Sheet, SheetName, Worksheet
Worksheet for query-table metadata. Defaults to the current DSL sheet, or the first worksheet outside the DSL.
Xml String requiredposition: namedpipeline: False
XML payload to add as package metadata.

Outputs

System.Management.Automation.PSObject