Enable-PSTrace
SYNOPSIS
Enables the Microsoft-Windows-PowerShell event provider logs.
SYNTAX
Enable-PSTrace [-Force] [-AnalyticOnly]
DESCRIPTION
> This cmdlet is only available on the Windows platform. This cmdlet enables the Operational and Analytic event logs of the Microsoft-Windows-PowerShell event provider.
You must run this cmdlet from an elevated PowerShell session.
EXAMPLES
Example 1: Enable the Analytic event log for PowerShell
Enable-PSTrace -AnalyticOnly
PARAMETERS
-AnalyticOnly
When this parameter is used, the cmdlet enables the Analytic event log of the Microsoft-Windows-PowerShell provider. The Operational event log is not changed.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
Used to force the change without prompting.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
INPUTS
None
OUTPUTS
None
NOTES
This cmdlet uses the `Get-LogProperties` and `Set-LogProperties` cmdlets.
You must run this cmdlet from an elevated PowerShell session.