You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Script that returns a boolean value. "True" if all prerequisites are installed, "False" if installation is required
224
+
$isInstalledScript= {
225
+
return$true
226
+
}
227
+
228
+
# Script that provides dynamic parameter for Install-PSFLoggingProvider
229
+
$installationParameters= {
230
+
# None needed
231
+
}
232
+
233
+
# Script that performs the actual installation, based on the parameters (if any) specified in the $installationParameters script
234
+
$installationScript= {
235
+
# Nothing to be done - if you need to install your filesystem, you probably have other issues you need to deal with first ;)
236
+
}
237
+
#endregion Function Extension / Integration
238
+
239
+
# Configuration settings to initialize
240
+
$configuration_Settings= {
241
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.FilePath'-Value ""-Initialize -Validation string -Handler { } -Description "The path to where the logfile is written. Supports some placeholders such as %Date% to allow for timestamp in the name. For full documentation on the supported wildcards, see the documentation on https://psframework.org"
242
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.Logname'-Value ""-Initialize -Validation string -Handler { } -Description "A special string you can use as a placeholder in the logfile path (by using '%logname%' as placeholder)"
243
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.IncludeHeader'-Value $true-Initialize -Validation bool -Handler { } -Description "Whether a written csv file will include headers"
244
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.Headers'-Value @('ComputerName','File','FunctionName','Level','Line','Message','ModuleName','Runspace','Tags','TargetObject','Timestamp','Type','Username') -Initialize -Validation stringarray -Handler { } -Description "The properties to export, in the order to select them."
245
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.FileType'-Value "CSV"-Initialize -Validation psframework.logfilefiletype -Handler { } -Description "In what format to write the logfile. Supported styles: CSV, XML, Html or Json. Html, XML and Json will be written as fragments."
246
+
Set-PSFConfig-Module þmoduleþ -Name 'Logging.þnameþ.CsvDelimiter'-Value ","-Initialize -Validation string -Handler { } -Description "The delimiter to use when writing to csv."
247
+
248
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.Enabled'-Value $false-Initialize -Validation "bool"-Handler { if ([PSFramework.Logging.ProviderHost]::Providers['þnameþ']) { [PSFramework.Logging.ProviderHost]::Providers['þnameþ'].Enabled =$args[0] } } -Description "Whether the logging provider should be enabled on registration"
249
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.AutoInstall'-Value $false-Initialize -Validation "bool"-Handler { } -Description "Whether the logging provider should be installed on registration"
250
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.InstallOptional'-Value $true-Initialize -Validation "bool"-Handler { } -Description "Whether installing the logging provider is mandatory, in order for it to be enabled"
251
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.IncludeModules'-Value @() -Initialize -Validation "stringarray"-Handler { if ([PSFramework.Logging.ProviderHost]::Providers['þnameþ']) { [PSFramework.Logging.ProviderHost]::Providers['þnameþ'].IncludeModules = ($args[0] |Write-Output) } } -Description "Module whitelist. Only messages from listed modules will be logged"
252
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.ExcludeModules'-Value @() -Initialize -Validation "stringarray"-Handler { if ([PSFramework.Logging.ProviderHost]::Providers['þnameþ']) { [PSFramework.Logging.ProviderHost]::Providers['þnameþ'].ExcludeModules = ($args[0] |Write-Output) } } -Description "Module blacklist. Messages from listed modules will not be logged"
253
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.IncludeTags'-Value @() -Initialize -Validation "stringarray"-Handler { if ([PSFramework.Logging.ProviderHost]::Providers['þnameþ']) { [PSFramework.Logging.ProviderHost]::Providers['þnameþ'].IncludeTags = ($args[0] |Write-Output) } } -Description "Tag whitelist. Only messages with these tags will be logged"
254
+
Set-PSFConfig-Module LoggingProvider -Name 'þnameþ.ExcludeTags'-Value @() -Initialize -Validation "stringarray"-Handler { if ([PSFramework.Logging.ProviderHost]::Providers['þnameþ']) { [PSFramework.Logging.ProviderHost]::Providers['þnameþ'].ExcludeTags = ($args[0] |Write-Output) } } -Description "Tag blacklist. Messages with these tags will not be logged"
0 commit comments