Export-OfficeExcelGoogleSpreadsheet
Plans, compiles or exports Excel workbooks to Google Sheets.
Syntax
Export-OfficeExcelGoogleSpreadsheet
[-Document <ExcelDocument>]
[-FailOnLoss]
[-Mode <Export| Plan| Batch>]
[-Options <Object[]>]
[-Session <GoogleWorkspaceSession>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#DocumentExport-OfficeExcelGoogleSpreadsheet
[-FailOnLoss]
[-Mode <Export| Plan| Batch>]
[-Options <Object[]>]
[-Path] <String[]>
[-Session <GoogleWorkspaceSession>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#PathExport-OfficeExcelGoogleSpreadsheet
[-FailOnLoss]
-LiteralPath <String[]>
[-Mode <Export| Plan| Batch>]
[-Options <Object[]>]
[-Session <GoogleWorkspaceSession>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#LiteralPathExamples
Inspect translation without signing in.
Export-OfficeExcelGoogleSpreadsheet -Path .\Report.xlsx -Mode PlanPreview a Google Sheets export
Export-OfficeExcelGoogleSpreadsheet -Path .\Reports\Q3-Sales.xlsx -Mode PlanReturns the translation plan, including anything Google Sheets cannot represent, without contacting Google.
Publish a workbook to Google Sheets
$googleSession = New-OfficeGoogleWorkspaceSession -KeyPath .\Secrets\reporting-sa.json -Scope Spreadsheets, DriveFile
Export-OfficeExcelGoogleSpreadsheet -Path .\Reports\Q3-Sales.xlsx -Session $googleSession -FailOnLossUploads the sales workbook through an authenticated Google Workspace session and stops if any content would be lost.
Build the request batch for your own client
$book = Open-OfficeExcel -Path .\Reports\Q3-Sales.xlsx -ReadOnly
$batch = Export-OfficeExcelGoogleSpreadsheet -Document $book -Mode Batch
Close-OfficeExcel -Document $bookReturns the provider-neutral request batch for an open workbook, for an integration that sends the requests itself.
Replace an existing spreadsheet in a shared folder
$googleSession = New-OfficeGoogleWorkspaceSession -KeyPath .\Secrets\reporting-sa.json -Scope Spreadsheets, DriveFile
$google = New-OfficeExcelGoogleSheetsOptions -Title 'Q3 sales' -FolderId $folderId -SpreadsheetId $spreadsheetId -UnsupportedFormula UseCachedValue
Export-OfficeExcelGoogleSpreadsheet -Path .\Reports\Q3-Sales.xlsx -Session $googleSession -Options $googleExports the workbook over an existing Google spreadsheet with a fixed title and preserved unsupported formulas.
Parameters
- -Document ExcelDocument
- Caller-owned document; omission uses the enclosing content block.
- -FailOnLoss SwitchParameter
- Reject translation warnings or errors before returning a result or mutating Google.
- -Mode GoogleSheetsExportMode
- Export by default, or return an offline Plan or Batch.
- Possible values:
Export,Plan,Batch - -Options Object[]
- One native options object and property hashtables applied to an independent snapshot.
- -Session GoogleWorkspaceSession
- Configured Google Workspace session, required for Export mode.
- -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- Prompts for confirmation before running the command.
- -Path String[]
- Source document paths, including filesystem wildcard patterns.
- -LiteralPath String[]
- Literal source paths; FileInfo.FullName and provider PSPath bind here.
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.