Skip to content

Commit 4fdffc3

Browse files
committed
Update example
1 parent 59f14c2 commit 4fdffc3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Examples/LoggerDemo.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
# Initialize the logger with default values
33
Start-ScriptLogger
44

5-
# Alternative: Specify all possible parameters for the logger
6-
Start-ScriptLogger -Path 'C:\Temp\test.log' -Format '{0:yyyy-MM-dd} {0:HH:mm:ss} {1} {2} {3,-11} {4}' -Level 'Verbose' -SkipEventLog -HideConsoleOutput
5+
# Second options, specify multiple custom settings for the logger
6+
Start-ScriptLogger -Path 'C:\Temp\test.log' -Format '{0:yyyy-MM-dd} {0:HH:mm:ss} {1} {2} {3,-11} {4}' -Level Warning -SkipEventLog -HideConsoleOutput
7+
8+
# Get the current script logger configuration object
9+
Get-ScriptLogger
10+
11+
# Update the script logger configuration
12+
Set-ScriptLogger -Level Verbose
713

814
# Log an error message
915
Write-ErrorLog -Message 'My Error Message'

0 commit comments

Comments
 (0)