Get-DiagnosticData
Fetches historical Windows Diagnostic Data uploaded by this machine.
Syntax
Default (Default)
Get-DiagnosticData
[[-StartTime] <DateTime>]
[[-EndTime] <DateTime>]
[[-RecordCount] <Int32>]
[-DiagnosticDataType <Int32>]
[-BasicTelemetryOnly]
[<CommonParameters>]
Description
This cmdlet fetches historical Windows Diagnostic Data uploaded by this machine. The total available historical data is limited by the diagnostic data store's configurations. See 'Set-DiagnosticStoreCapacity' for changes.
Examples
EXAMPLE 1
Get-DiagnosticData -StartTime (Get-Date).AddDays(-1) -RecordCount 1
Returns first (oldest) diagnostic event since yesterday. Sample output below.
Name : Microsoft.Windows.Kernel.PnP.DeviceConfig
Timestamp : 11/8/2018 4:52:53 PM
Payload : JSON PAYLOAD
IsBasic : False
DiagnosticDataTypes : {11}
EXAMPLE 2
Get-DiagnosticData -StartTime (Get-Date).AddHours(-12) -EndTime (Get-Date).AddHours(-6) -BasicTelemetryOnly
Returns all basic diagnostic events sent between 12 and 6 hours before now.
EXAMPLE 3
Get-DiagnosticData -DiagnosticDataType 11
Returns diagnostic events tagged with diagnostic data type ID 11. See Get-DiagnosticDataTypes for the list of diagnostic data types.
Parameters
-BasicTelemetryOnly
Query filter parameter. Specifies if resultset should only include Basic diagnostic data events.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | basic, basicOnly |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DiagnosticDataType
Query filter parameter. Specifies if resultset should only include events having this diagnostic data type. See Get-DiagnosticDataTypes for data type IDs.
Parameter properties
Type: | Int32 |
Default value: | -2147483648 |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ddt, dt |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-EndTime
Query filter parameter. Specifies end time of the window for the newest event in the fetched set.
Parameter properties
Type: | DateTime |
Default value: | 12/31/9999 11:59:59 PM |
Supports wildcards: | False |
DontShow: | False |
Aliases: | et, end |
Parameter sets
(All)
Position: | 1 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-RecordCount
Specifies maximum number of events to fetch.
Parameter properties
Type: | Int32 |
Default value: | 0 |
Supports wildcards: | False |
DontShow: | False |
Aliases: | rc, recCount, c, count |
Parameter sets
(All)
Position: | 2 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-StartTime
Query filter parameter. Specifies start time of the window for the oldest event in the fetched set.
Parameter properties
Type: | DateTime |
Default value: | 1/1/0001 12:00:00 AM |
Supports wildcards: | False |
DontShow: | False |
Aliases: | st, start |
Parameter sets
(All)
Position: | 0 |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
DateTime
Query filter parameter. Specifies start time of the window for the oldest event in the fetched set.
DateTime
Query filter parameter. Specifies end time of the window for the newest event in the fetched set.
Int32
Specifies maximum number of events to fetch.
Outputs
DDVCmdlets.Containers.EventRecord
Persisted event record.
Notes
Requires Windows 10 version 17134 (1803) or higher