File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2
2
# Initialize the logger with default values
3
3
Start-ScriptLogger
4
4
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
7
13
8
14
# Log an error message
9
15
Write-ErrorLog - Message ' My Error Message'
You can’t perform that action at this time.
0 commit comments