API Reference
Command
New-OfficeExcel
Creates a new Excel workbook using the DSL.
Remarks
Creates a new Excel workbook using the DSL.
Examples
Create a workbook with a sheet and a few cells.
PS>New-OfficeExcel -Path .\report.xlsx { ExcelSheet 'Data' { ExcelCell -Address 'A1' -Value 'Region' } }
Creates report.xlsx and writes “Region” into cell A1 on the Data worksheet.
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
New-OfficeExcel [-AutoSave] [-Content <ScriptBlock>] -FilePath <String> [-NoSave] [-Open] [-PassThru] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AutoSave SwitchParameter
- Opt into OfficeIMO automatic saves during operations.
- Content ScriptBlock
- DSL scriptblock describing workbook content.
- FilePath String
- Destination path for the workbook.
- NoSave SwitchParameter
- Skip saving the workbook after running the DSL.
- Open SwitchParameter
- Open the workbook in Excel after saving.
- PassThru SwitchParameter
- Emit a FileInfo for convenience.
Outputs
System.Object