編集

次の方法で共有


Get-DiagnosticData

Fetches historical Windows Diagnostic Data uploaded by this machine.

Syntax

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.

Type:SwitchParameter
Aliases:basic, basicOnly
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DiagnosticDataType

Query filter parameter. Specifies if resultset should only include events having this diagnostic data type. See Get-DiagnosticDataTypes for data type IDs.

Type:Int32
Aliases:ddt, dt
Position:Named
Default value:-2147483648
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndTime

Query filter parameter. Specifies end time of the window for the newest event in the fetched set.

Type:DateTime
Aliases:et, end
Position:1
Default value:12/31/9999 11:59:59 PM
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RecordCount

Specifies maximum number of events to fetch.

Type:Int32
Aliases:rc, recCount, c, count
Position:2
Default value:0
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StartTime

Query filter parameter. Specifies start time of the window for the oldest event in the fetched set.

Type:DateTime
Aliases:st, start
Position:0
Default value:1/1/0001 12:00:00 AM
Required:False
Accept pipeline input:True
Accept wildcard characters:False

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