Disable-PSTrace
Disables the PowerShellCore event provider logs.
Syntax
Default (Default)
Disable-PSTrace
[-AnalyticOnly]
[<CommonParameters>]
Description
This cmdlet is only available on the Windows platform.
This cmdlet disables the Operational and Analytic event logs of the PowerShellCore event provider.
You must run this cmdlet from an elevated PowerShell session.
Note
Prior to PowerShell 7.6, this command only disabled logging for the Microsoft-Windows-PowerShell event provider.
Examples
Example 1: Disable the Analytic event log for PowerShell
The following example disables only the Analytic event log of the PowerShellCore provider.
Disable-PSTrace -AnalyticOnly
Parameters
-AnalyticOnly
When this parameter is used, the cmdlet disables the Analytic event log of the PowerShellCore provider. The Operational event log is not changed.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| 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
None
You can't pipe objects to this cmdlet.
Outputs
None
This cmdlet returns no output.
Notes
This cmdlet uses the Get-LogProperties and Set-LogProperties cmdlets.
You must run this cmdlet from an elevated PowerShell session.