Cmdlet
Add-OfficeExcelReportCallout
Adds a highlighted info, success, warning or error callout.
Syntax
Add-OfficeExcelReportCallout
[[-Kind] <Info| Success| Warning| Error| Critical>]
[-PassThru]
[-Span <Int32>]
[-Text] <String>
[-Title] <String>
[<CommonParameters>]#Parameter set:
DefaultExamples
Add an information callout
New-OfficeExcel -Path .\Reports\Operations.xlsx {
ExcelReportSheet 'Summary' {
ExcelReportCallout Info 'Data source' 'Monitoring export from 1 November, 06:00.'
}
}Highlights a note for readers in an information callout.
Report results with matching callouts
$failed = Import-OfficeCsv -Path .\Data\Backup-Results.csv | Where-Object Result -ne 'Success'
New-OfficeExcel -Path .\Reports\Backup-Check.xlsx {
ExcelReportSheet 'Backups' {
ExcelReportTitle 'Nightly backup check' (Get-Date).ToString('d MMMM yyyy')
if ($failed) {
ExcelReportCallout Error 'Backups failed' "$(@($failed).Count) jobs did not complete. Details are below."
ExcelReportTable $failed 'Failed jobs'
} else {
ExcelReportCallout Success 'All backups completed' 'Every scheduled job finished successfully.'
}
}
}Adds a success or error callout depending on whether the backup checks passed, so the outcome is the first thing a reader sees.
Parameters
- -Kind OfficeExcelReportCalloutKind
- Metadata kind to add.
- Possible values:
Info,Success,Warning,Error,Critical - -PassThru SwitchParameter
- Emits the native result after the operation.
- -Span Int32
- Number of worksheet columns occupied by the report block.
- -Text String
- Comment text.
- -Title String
- Chart title.
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.