Skip to content

Commit

Permalink
Added details
Browse files Browse the repository at this point in the history
  • Loading branch information
VertigoRay committed Jan 12, 2023
1 parent 53e6cdf commit 8025979
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
```
Expand Down

0 comments on commit 8025979

Please sign in to comment.