< Back

Set-PSFLoggingProvider

Sun Jan 19, 2020 6:44 pm

NAME Set-PSFLoggingProvider



SYNOPSIS

Configures a logging provider.





SYNTAX

Set-PSFLoggingProvider [[-Name] <String>] [[-Enabled] <Boolean>] [[-IncludeModules] <String[]>] [[-ExcludeModules]

<String[]>] [[-IncludeTags] <String[]>] [[-ExcludeTags] <String[]>] [-EnableException] [<CommonParameters>]





DESCRIPTION

This command allows configuring the way a logging provider works.

This grants the ability to ...

- Enable / Disable a provider

- Set additional parameters defined by the provider (each provider may implement its own settings, exposed through

dynamic parameters)

- Configure filters about what messages get sent to a given provider.





PARAMETERS

-Name <String>

The name of the provider to configure



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Enabled <Boolean>

Whether the provider should be enabled or disabled.



Required? false

Position? 2

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-IncludeModules <String[]>

Only messages from modules listed here will be logged.

Exact match only, an empty list results in all modules being logged.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeModules <String[]>

Messages from excluded modules will not be logged using this provider.

Overrides -IncludeModules in case of overlap.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-IncludeTags <String[]>

Only messages containing the listed tags will be logged.

Exact match only, only a single match is required for a message to qualify.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeTags <String[]>

Messages containing any of the listed tags will not be logged.

Overrides -IncludeTags in case of overlap.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

This parameters disables user-friendly warnings and enables the throwing of exceptions.

This is less user friendly, but allows catching exceptions in calling scripts.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Set-PSFLoggingProvider -Name filesystem -Enabled $false



Disables the filesystem provider.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Set-PSFLoggingProvider -Name filesystem -ExcludeModules "PSFramework"



Prevents all messages from the PSFramework module to be logged to the file system











RELATED LINKS