From 8025979f291a686e835d9e847c089740871da80b Mon Sep 17 00:00:00 2001 From: Raymond Piller Date: Thu, 12 Jan 2023 02:13:35 -0600 Subject: [PATCH] Added details --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a3c400d..c2cbc11 100644 --- a/README.md +++ b/README.md @@ -57,20 +57,10 @@ Write-Host 'Hello World!' > ℹ: You'll notice that the `Hello World!` message did output to host as expected. -Because nothing was configured, you can find the log in the default location: +Because nothing was configured, you can find the log in the [default location](#filepath): - `%TEMP%\PowerShell Desktop 5.1.19041.1682 Internal.log` -> ℹ: The default file name will vary depending on your environment, but it can be gleaned with this command: -> -> ```powershell -> [IO.Path]::Combine($env:Temp, ('PowerShell {0} {1} {2}.log' -f @( -> $PSVersionTable.PSEdition, -> $PSVersionTable.PSVersion, -> $MyInvocation.CommandOrigin -> ))) -> ``` - If you open that file, you can see that the log appears in *CMTrace* format: ```xml @@ -196,6 +186,9 @@ $PSDefaultParameterValues.Set_Item('Write-Log:DisableLogging', $false) )) ``` +The default file name will vary depending on your environment. +Change the location by providing the full path to the log file. + ```powershell $PSDefaultParameterValues.Set_Item('Write-Log:FilePath', "${env:SystemRoot}\Logs\MyApp.log") ```