Convert-MtResultsToFlatObject
SYNOPSISโ
Convert Maester test results to a flattened object that can be exported to CSV or Excel.
SYNTAXโ
FromFile (Default)โ
Convert-MtResultsToFlatObject [-JsonFilePath] <String> [-ExportCsv] [-ExportExcel] [-CsvFilePath <String>]
[-ExcelFilePath <String>] [-Force] [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
XLSXโ
Convert-MtResultsToFlatObject [-InputObject] <PSObject> [-JsonFilePath] <String> [-ExportCsv] [-ExportExcel]
[-ExcelFilePath <String>] [-Force] [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
CSVโ
Convert-MtResultsToFlatObject [-InputObject] <PSObject> [-JsonFilePath] <String> [-ExportCsv] [-ExportExcel]
[-CsvFilePath <String>] [-Force] [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
FromInputObjectโ
Convert-MtResultsToFlatObject [-InputObject] <PSObject> [-ExportCsv] [-ExportExcel] [-CsvFilePath <String>]
[-ExcelFilePath <String>] [-Force] [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTIONโ
Convert Maester test results to a flattened object that can be exported to CSV or Excel. This function exports the data to a CSV file by default, but can also export to an Excel file if the ImportExcel module is installed.
The function also supports reading Maester test results from a JSON file and exporting the flattened object to a CSV.
EXAMPLESโ
EXAMPLE 1โ
Convert-MtResultsToFlatObject -JsonFilePath 'C:\path\to\results.json'
Convert the Maester test results in C:\path\to\results.json to a flattened object that is then returned to the pipeline.
EXAMPLE 2โ
Convert-MtResultsToFlatObject -JsonFilePath 'C:\path\to\results.json' -ExportExcel
Convert the Maester test results in C:\path\to\results.json to a flattened object, and then export that object to an Excel file (C:\path\to\results.xlsx). Requires the ImportExcel module.
EXAMPLE 3โ
Convert-MtResultsToFlatObject -JsonFilePath 'C:\path\to\results.json' -ExportCsv -CsvFilePath 'C:\path\to\results.csv'
Convert the Maester test results in C:\path\to\results.json to a flattened object, and then export that object to C:\path\to\results.csv.
PARAMETERSโ
-InputObjectโ
Use the Maester test results from the pipeline or as an input object (JSON).
Type: PSObject
Parameter Sets: XLSX, CSV, FromInputObject
Aliases: MaesterResults
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-JsonFilePathโ
The path of the file containing the Maester test results in JSON format.
Type: String
Parameter Sets: FromFile, XLSX, CSV
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ExportCsvโ
Export the flattened object to a CSV file.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ExportExcelโ
Export the flattened object to an Excel workbook using the ImportExcel module.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-CsvFilePathโ
The path of the file to export CSV data to.
Type: String
Parameter Sets: FromFile, CSV, FromInputObject
Aliases:
Required: False
Position: Named
Default value: "$($JsonFilePath -replace '\.json$', '.csv')"
Accept pipeline input: False
Accept wildcard characters: False
-ExcelFilePathโ
The path of the file to export an Excel worksheet to.
Type: String
Parameter Sets: FromFile, XLSX, FromInputObject
Aliases:
Required: False
Position: Named
Default value: "$($JsonFilePath -replace '\.json$', '.xlsx')"
Accept pipeline input: False
Accept wildcard characters: False
-Forceโ
Force the export to a CSV/XLSX file even if the file already exists.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-PassThruโ
Return the flattened object to the pipeline.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ProgressActionโ
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParametersโ
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTSโ
OUTPUTSโ
System.Collections.Generic.List[PSObject]โ
NOTESโ
Due to limitations in CSV files and Excel cells, the ResultDetails property is limited to 30000 characters. If the test result details are longer than this, that section will be truncated and a notification will be included in its place. This is most likely to happen when details about a large number of users is included in the result details. The full details are still available in the JSON file and the HTML report.
RELATED LINKSโ
https://maester.dev/docs/commands/Convert-MtResultsToFlatObject